Boruta.Oauth.Authorization protocol (Boruta core v3.0.0-beta.4)

View Source

OAuth requests authorization

Summary

Functions

Checks if request is valid for token creation for given request, depending of implementation.

Creates and returns tokens for given request, depending of implementation.

Types

t()

@type t() :: term()

Functions

preauthorize(request)

@spec preauthorize(request :: any()) ::
  {:ok, Boruta.Oauth.AuthorizationSuccess.t()}
  | {:error, Boruta.Oauth.Error.t()}

Checks if request is valid for token creation for given request, depending of implementation.

token(request)

@spec token(request :: any()) ::
  {:ok,
   Boruta.Oauth.Token.t()
   | %{
       required(type :: :code | :token | :id_token) =>
         token :: Boruta.Oauth.Token.t() | String.t()
     }}
  | {:error, reason :: term()}
  | {:error, Boruta.Oauth.Error.t()}

Creates and returns tokens for given request, depending of implementation.