Boruta.Oauth.Application behaviour (Boruta core v3.0.0-beta.4)

View Source

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

Note: This behaviour is split into Boruta.Oauth.AuthorizeApplication, Boruta.Oauth.TokenApplication, Boruta.Oauth.IntrospectApplication, and Boruta.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 Boruta.Oauth.authorize/3

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

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

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

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

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

This function will be triggered in case of failure invoking Boruta.Oauth.pushed_authorization_request/2

This function will be triggered in case of failure invoking Boruta.Oauth.pushed_authorization_request/2

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

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

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

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

Callbacks

authorize_error(conn, oauth_error)

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

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

authorize_success(conn, authorize_response)

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

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

introspect_error(conn, oauth_error)

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

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

introspect_success(conn, introspect_response)

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

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

preauthorize_error(conn, oauth_error)

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

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

preauthorize_success(conn, authorization)

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

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

pushed_authorization_error(conn, oauth_error)

@callback pushed_authorization_error(
  conn :: Plug.Conn.t(),
  oauth_error :: Boruta.Oauth.Error.t()
) :: any()

This function will be triggered in case of failure invoking Boruta.Oauth.pushed_authorization_request/2

request_stored(conn, response)

@callback request_stored(
  conn :: Plug.Conn.t(),
  response :: Boruta.Oauth.PushedAuthorizationResponse.t()
) ::
  any()

This function will be triggered in case of failure invoking Boruta.Oauth.pushed_authorization_request/2

revoke_error(conn, oauth_error)

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

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

revoke_success(conn)

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

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

token_error(conn, oauth_error)

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

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

token_success(conn, token_response)

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

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