View Source oidcc_logout (Oidcc v3.2.6)

Logout from the OpenID Provider.

Summary

Types

Configure Relaying Party initiated Logout URI.

Functions

Initiate URI for Relaying Party initiated Logout.

Types

-type error() :: end_session_endpoint_not_supported.
Link to this type

initiate_url_opts()

View Source (since 3.0.0)
-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 provider
  • post_logout_redirect_uri - Post Logout Redirect URI to pass to the provider
  • state - state to pass to the provider
  • ui_locales - UI locales to pass to the provider
  • extra_query_params - extra query params to add to the URI

Functions

Link to this function

initiate_url(Token, ClientContext, Opts)

View Source (since 3.0.0)
-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