View Source Boruta.Oauth (Boruta core v2.3.3)

OAuth requests entrypoint, provides authorization artifacts to clients as stated in RFC.

Note: this module follows inverted heaxagonal architecture, its functions will invoke callbacks of the given module argument and return its result.

The definition of those callbacks are provided by either Boruta.Oauth.Application or Boruta.Oauth.AuthorizeApplication, Boruta.Oauth.TokenApplication, Boruta.Oauth.IntrospectApplication, and Boruta.Oauth.RevokeApplication,

Summary

Functions

Link to this function

authorize(conn, resource_owner, module)

View Source
@spec authorize(
  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 and OpenID Connect Core 1.0 incorporating errata set 1.

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
@spec 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
@spec preauthorize(
  conn :: Plug.Conn.t() | map(),
  resource_owner :: Boruta.Oauth.ResourceOwner.t(),
  module :: atom()
) :: any()

Check success of an authorize request as stated in RFC 6749 - The OAuth 2.0 Authorization Framework and OpenID Connect Core 1.0 incorporating errata set 1.

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.

@spec 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.

@spec 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.