# `AshAuthentication.Oauth2Server.Metadata`
[🔗](https://github.com/team-alembic/ash_authentication_oauth2_server/blob/v0.1.0/lib/ash_authentication/oauth2_server/metadata.ex#L5)

Builders for the discovery metadata endpoints.

  * `protected_resource/1` (RFC 9728) — for the resource server, served at
    `/.well-known/oauth-protected-resource`.
  * `authorization_server/1` (RFC 8414) — for the authorization server,
    served at `/.well-known/oauth-authorization-server`.

Both return plain maps; controllers JSON-encode them.

# `authorization_server`

```elixir
@spec authorization_server(server :: module()) :: map()
```

Build the OAuth Authorization Server Metadata document (RFC 8414).

Endpoint paths are derived from the `issuer_url` so that mounting under a
custom prefix works without configuration.

# `protected_resource`

```elixir
@spec protected_resource(server :: module()) :: map()
```

Build the OAuth Protected Resource Metadata document (RFC 9728).

---

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