View Source oidcc_logout (Oidcc v3.2.6)
Logout from the OpenID Provider.
Summary
Functions
Initiate URI for Relaying Party initiated Logout.
Types
-type error() :: end_session_endpoint_not_supported.
-type initiate_url_opts() :: #{logout_hint => binary(), post_logout_redirect_uri => uri_string:uri_string(), state => binary(), ui_locales => binary(), extra_query_params => oidcc_http_util:query_params()}.
Configure Relaying Party initiated Logout URI.
See https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout.
Parameters
logout_hint
- logout_hint to pass to the providerpost_logout_redirect_uri
- Post Logout Redirect URI to pass to the providerstate
- state to pass to the providerui_locales
- UI locales to pass to the providerextra_query_params
- extra query params to add to the URI
Functions
-spec initiate_url(Token, ClientContext, Opts) -> {ok, uri_string:uri_string()} | {error, error()} when Token :: IdToken | oidcc_token:t() | undefined, IdToken :: binary(), ClientContext :: oidcc_client_context:t(), Opts :: initiate_url_opts().
Initiate URI for Relaying Party initiated Logout.
See https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout.
For a high level interface using oidcc_provider_configuration_worker
see oidcc:initiate_logout_url/4
.
Examples
{ok, ClientContext} = oidcc_client_context:from_configuration_worker(
provider_name,
<<"client_id">>,
unauthenticated
),
%% Get `Token` from `oidcc_token`
{ok, RedirectUri} =
oidcc_logout:initiate_url(
Token,
ClientContext,
#{post_logout_redirect_uri: <<"https://my.server/return">}
),
%% RedirectUri = https://my.provider/logout?id_token_hint=IDToken&client_id=ClientId&post_logout_redirect_uri=https%3A%2F%2Fmy.server%2Freturn