Backplane.Oauth.Application behaviour (backplane_oauth v1.10.77)

Copy Markdown View Source

Implement this behaviour in the application layer of your OAuth / OpenID Connect provider. This behaviour gives all callbacks triggered invoking Backplane.Oauth module functions.

Note: This behaviour is split into Backplane.Oauth.AuthorizeApplication, Backplane.Oauth.TokenApplication, Backplane.Oauth.IntrospectApplication, and Backplane.Oauth.RevokeApplication providing utilities to implement the different OAuth / OpenID Connect endpoints independently.

Summary

Callbacks

This function will be triggered in case of failure invoking Backplane.Oauth.authorize/3

This function will be triggered in case of success invoking Backplane.Oauth.authorize/3

This function will be triggered in case of failure invoking Backplane.Oauth.introspect/2

This function will be triggered in case of success invoking Backplane.Oauth.introspect/2

This function will be triggered in case of failure invoking Backplane.Oauth.preauthorize/3

This function will be triggered in case of success invoking Backplane.Oauth.preauthorize/3

This function will be triggered in case of failure invoking Backplane.Oauth.revoke/2

This function will be triggered in case of success invoking Backplane.Oauth.revoke/2

This function will be triggered in case of failure invoking Backplane.Oauth.token/2

This function will be triggered in case of success invoking Backplane.Oauth.token/2

Callbacks

authorize_error(conn, oauth_error)

@callback authorize_error(conn :: Plug.Conn.t(), oauth_error :: Backplane.Oauth.Error.t()) ::
  any()

This function will be triggered in case of failure invoking Backplane.Oauth.authorize/3

authorize_success(conn, authorize_response)

@callback authorize_success(
  conn :: Plug.Conn.t(),
  authorize_response :: Backplane.Oauth.AuthorizeResponse.t()
) :: any()

This function will be triggered in case of success invoking Backplane.Oauth.authorize/3

introspect_error(conn, oauth_error)

@callback introspect_error(
  conn :: Plug.Conn.t(),
  oauth_error :: Backplane.Oauth.Error.t()
) :: any()

This function will be triggered in case of failure invoking Backplane.Oauth.introspect/2

introspect_success(conn, introspect_response)

@callback introspect_success(
  conn :: Plug.Conn.t(),
  introspect_response :: Backplane.Oauth.IntrospectResponse.t()
) :: any()

This function will be triggered in case of success invoking Backplane.Oauth.introspect/2

preauthorize_error(conn, oauth_error)

(optional)
@callback preauthorize_error(
  conn :: Plug.Conn.t(),
  oauth_error :: Backplane.Oauth.Error.t()
) :: any()

This function will be triggered in case of failure invoking Backplane.Oauth.preauthorize/3

preauthorize_success(conn, authorization)

(optional)
@callback preauthorize_success(
  conn :: Plug.Conn.t(),
  authorization :: Backplane.Oauth.AuthorizationSuccess.t()
) :: any()

This function will be triggered in case of success invoking Backplane.Oauth.preauthorize/3

revoke_error(conn, oauth_error)

@callback revoke_error(conn :: Plug.Conn.t(), oauth_error :: Backplane.Oauth.Error.t()) ::
  any()

This function will be triggered in case of failure invoking Backplane.Oauth.revoke/2

revoke_success(conn)

@callback revoke_success(conn :: Plug.Conn.t()) :: any()

This function will be triggered in case of success invoking Backplane.Oauth.revoke/2

token_error(conn, oauth_error)

@callback token_error(conn :: Plug.Conn.t(), oauth_error :: Backplane.Oauth.Error.t()) ::
  any()

This function will be triggered in case of failure invoking Backplane.Oauth.token/2

token_success(conn, token_response)

@callback token_success(
  conn :: Plug.Conn.t(),
  token_response :: Backplane.Oauth.TokenResponse.t()
) :: any()

This function will be triggered in case of success invoking Backplane.Oauth.token/2