Boruta.Oauth (Boruta core v1.2.0) View Source

Boruta OAuth entrypoint, handles OAuth requests.

Note : this module follows inverted heaxagonal architecture, its functions will invoke functions of the given argument module as result. The definition of the callbacks are provided by either Boruta.Oauth.Application or Boruta.Oauth.AuthorizeApplication, Boruta.Oauth.TokenApplication, Boruta.Oauth.IntrospectApplication, and Boruta.Oauth.RevokeApplication,

Link to this section Summary

Link to this section Functions

Link to this function

authorize(conn, resource_owner, module)

View Source

Specs

authorize(
  conn :: Plug.Conn.t() | map(),
  resource_owner :: Boruta.Oauth.ResourceOwner.t(),
  module :: atom()
) :: any()

Process an authorize request and returns a token as stated in RFC 6749 - The OAuth 2.0 Authorization Framework.

Triggers authorize_success in case of success and authorize_error in case of failure from the given module. Those functions are described in Boruta.Oauth.Application behaviour.

Link to this function

introspect(conn, module)

View Source

Specs

introspect(conn :: Plug.Conn.t() | map(), module :: atom()) :: any()

Process a introspect request as stated in RFC 7662 - OAuth 2.0 Token Introspection.

Triggers introspect_success in case of success and introspect_error in case of failure from the given module. Those functions are described in Boruta.Oauth.Application behaviour.

Link to this function

preauthorize(conn, resource_owner, module)

View Source

Specs

preauthorize(
  conn :: Plug.Conn.t() | map(),
  resource_owner :: Boruta.Oauth.ResourceOwner.t(),
  module :: atom()
) :: any()

Process an authorize request as stated in RFC 6749 - The OAuth 2.0 Authorization Framework.

Triggers preauthorize_success in case of success and preauthorize_error in case of failure from the given module. Those functions are described in Boruta.Oauth.Application behaviour.

Specs

revoke(conn :: Plug.Conn.t() | map(), module :: atom()) :: any()

Process a revoke request as stated in RFC 7009 - OAuth 2.0 Token Revocation.

Triggers revoke_success in case of success and revoke_error in case of failure from the given module. Those functions are described in Boruta.Oauth.Application behaviour.

Specs

token(conn :: Plug.Conn.t() | map(), module :: atom()) :: any()

Process an token request as stated in RFC 6749 - The OAuth 2.0 Authorization Framework.

Triggers token_success in case of success and token_error in case of failure from the given module. Those functions are described in Boruta.Oauth.Application behaviour.