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

OAuth application behaviour - authorize endpoint

Implement this behaviour in the application layer of your OAuth provider. The callbacks are triggered while calling functions from `Backplane.Oauth` module.

# `authorize_error`

```elixir
@callback authorize_error(conn :: Plug.Conn.t(), oauth_error :: Backplane.Oauth.Error.t()) ::
  any()
```

This function will be triggered in case of failure invoking `Backplane.Oauth.authorize/3`

# `authorize_success`

```elixir
@callback authorize_success(
  conn :: Plug.Conn.t(),
  authorize_response :: Backplane.Oauth.AuthorizeResponse.t()
) :: any()
```

This function will be triggered in case of success invoking `Backplane.Oauth.authorize/3`

# `preauthorize_error`
*optional* 

```elixir
@callback preauthorize_error(
  conn :: Plug.Conn.t(),
  oauth_error :: Backplane.Oauth.Error.t()
) :: any()
```

This function will be triggered in case of failure invoking `Backplane.Oauth.preauthorize/3`

# `preauthorize_success`
*optional* 

```elixir
@callback preauthorize_success(
  conn :: Plug.Conn.t(),
  authorization :: Backplane.Oauth.AuthorizationSuccess.t()
) :: any()
```

This function will be triggered in case of success invoking `Backplane.Oauth.preauthorize/3`

---

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