View Source Zoth.OpenId (Zoth v1.0.1)
Logic to allow working with Open ID.
Link to this section Summary
Functions
End the current session for the given user based on the request params. If the given ID Token is valid then we revoke all access tokens for the user that are associated to the application that issued the token. Users must re-authenticate after this.
Returns the nonce if present in the request params.
Returns an ID token based on the given access token and context.
Returns the public key used for signing ID tokens.
Returns true if "openid" is in the given scopes.
Returns all of the claims supported by the current config.
Sign the given ID token. This relies on the configured signing_key, algorithm and key ID. See OpenIdConfig for more info.
Link to this section Types
@type id_token() :: %{ :aud => String.t(), :exp => non_neg_integer(), :iat => non_neg_integer(), :iss => String.t(), :sub => String.t(), optional(:auth_time) => non_neg_integer(), optional(:email) => String.t(), optional(:email_verified) => boolean(), optional(:nonce) => String.t() }
Link to this section Functions
@spec end_session(request_params :: map(), opts :: keyword()) :: :ok | {:ok, {:redirect, String.t()}} | {:error, any()}
End the current session for the given user based on the request params. If the given ID Token is valid then we revoke all access tokens for the user that are associated to the application that issued the token. Users must re-authenticate after this.
See OpenID documentation for more information.
Returns the nonce if present in the request params.
@spec generate_id_token( access_token :: Zoth.AccessTokens.AccessToken.t(), context :: map(), config :: keyword() ) :: id_token()
Returns an ID token based on the given access token and context.
@spec get_public_key(config :: Zoth.OpenId.OpenIdConfig.t()) :: map()
Returns the public key used for signing ID tokens.
Returns true if "openid" is in the given scopes.
@spec list_claims(config :: Zoth.OpenId.OpenIdConfig.t()) :: [Zoth.OpenId.Claim.t()]
Returns all of the claims supported by the current config.
Sign the given ID token. This relies on the configured signing_key, algorithm and key ID. See OpenIdConfig for more info.