# `AshAtproto.Auth.Plug`

A Plug for the atproto oauth strategy.

Provides routes for the oauth phases of request and callback, along with a client metadata JSON.

# `callback`

```elixir
@spec callback(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()
```

Perform the callback phase of atproto oauth.

Responds to a user being redirected back from the remote authentication
provider, and validates the passed options, ultimately registering or
signing-in a user if the authentication was successful.

# `client_metadata`

```elixir
@spec client_metadata(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()
```

# `request`

```elixir
@spec request(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()
```

Perform the request phase of atproto oauth.

Builds a redirection URL based on the provider configuration and redirects the
user to that endpoint.

---

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