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

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

Functions

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

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