# `Backplane.Oauth.Authorization`
[🔗](https://github.com/gsmlg-opt/backplane/blob/v1.10.77/apps/backplane_oauth/lib/backplane/oauth/authorization.ex#L1)

OAuth requests authorization

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `preauthorize`

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

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

# `token`

```elixir
@spec token(request :: any()) ::
  {:ok,
   Backplane.Oauth.Token.t()
   | %{
       required(type :: :code | :token | :id_token) =&gt;
         token :: Backplane.Oauth.Token.t() | String.t()
     }}
  | {:error, reason :: term()}
  | {:error, Backplane.Oauth.Error.t()}
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
