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

Copy Markdown 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 Backplane.Oauth module.

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.preauthorize/3

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

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

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