Boruta.Oauth.AuthorizeApplication behaviour (Boruta core v2.0.0-rc.1) View Source

OAuth application behaviour - authorize endpoint

Implement this behaviour in the application layer of your OAuth provider. The callbacks are triggered while calling functions from Boruta.Oauth module.

Link to this section 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.preauthorize/3

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

Link to this section Callbacks

Link to this callback

authorize_error(conn, oauth_error)

View Source

Specs

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

Link to this callback

authorize_success(conn, authorize_response)

View Source

Specs

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

Link to this callback

preauthorize_error(conn, oauth_error)

View Source (optional)

Specs

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

Link to this callback

preauthorize_success(conn, authorization)

View Source (optional)

Specs

preauthorize_success(
  conn :: Plug.Conn.t(),
  authorization :: %Boruta.Oauth.AuthorizationSuccess{
    client: term(),
    code: term(),
    code_challenge: term(),
    code_challenge_method: term(),
    nonce: term(),
    redirect_uri: term(),
    resource_owner: term(),
    response_types: term(),
    scope: term(),
    state: term(),
    sub: term()
  }
) :: any()

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