View Source Boruta.Openid.Application behaviour (Boruta core v3.0.0-beta.1)

Implement this behaviour in the application layer of your OpenID Connect provider. This behaviour gives all callbacks triggered invoking Boruta.Openid module functions.

Note: This behaviour is split into Boruta.Openid.JwksApplication and Boruta.Openid.UserinfoApplication providing utilities to implement the different OpenID Connect endpoints independently.

Summary

Callbacks

This function will be triggered when request is unauthorized invoking Boruta.Openid.register_client/3

This function will be triggered in case of success invoking Boruta.Openid.credential/3

This function will be triggered in case of failure invoking Boruta.Openid.credential/3

This function will be triggered in case of success invoking Boruta.Openid.jwks/2

This function will be triggered when request is unauthorized invoking Boruta.Openid.register_client/3

This function will be triggered when request is unauthorized invoking Boruta.Openid.userinfo/2

This function will be triggered in case of success invoking Boruta.Openid.userinfo/2

Types

@type direct_post_params() :: %{code_id: String.t(), id_token: nil | String.t()}

Callbacks

Link to this callback

authentication_failure(conn, error)

View Source
@callback authentication_failure(conn :: Plug.Conn.t(), error :: Boruta.Oauth.Error.t()) ::
  any()
Link to this callback

client_registered(conn, client)

View Source
@callback client_registered(conn :: Plug.Conn.t(), client :: Boruta.Oauth.Client.t()) ::
  any()

This function will be triggered when request is unauthorized invoking Boruta.Openid.register_client/3

@callback code_not_found(conn :: Plug.Conn.t()) :: any()
Link to this callback

credential_created(conn, credential)

View Source
@callback credential_created(
  conn :: Plug.Conn.t(),
  credential :: Boruta.Openid.CredentialResponse.t()
) ::
  any()

This function will be triggered in case of success invoking Boruta.Openid.credential/3

Link to this callback

credential_failure(conn, error)

View Source
@callback credential_failure(conn :: Plug.Conn.t(), error :: Boruta.Oauth.Error.t()) ::
  any()

This function will be triggered in case of failure invoking Boruta.Openid.credential/3

Link to this callback

direct_post_success(conn, response)

View Source
@callback direct_post_success(
  conn :: Plug.Conn.t() | map(),
  response :: any()
) :: any()
Link to this callback

jwk_list(conn, jwk_keys)

View Source
@callback jwk_list(
  conn :: Plug.Conn.t(),
  jwk_keys :: [%JOSE.JWK{fields: term(), keys: term(), kty: term()}]
) :: any()

This function will be triggered in case of success invoking Boruta.Openid.jwks/2

Link to this callback

registration_failure(conn, changeset)

View Source
@callback registration_failure(conn :: Plug.Conn.t(), changeset :: Ecto.Changeset.t()) ::
  any()

This function will be triggered when request is unauthorized invoking Boruta.Openid.register_client/3

Link to this callback

unauthorized(conn, error)

View Source
@callback unauthorized(conn :: Plug.Conn.t(), error :: Boruta.Oauth.Error.t()) :: any()

This function will be triggered when request is unauthorized invoking Boruta.Openid.userinfo/2

Link to this callback

userinfo_fetched(conn, userinfo)

View Source
@callback userinfo_fetched(conn :: Plug.Conn.t(), userinfo :: map()) :: any()

This function will be triggered in case of success invoking Boruta.Openid.userinfo/2