# `ExMCP.Authorization.RegistrationPolicy`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/authorization/registration_policy.ex#L1)

Selects the OAuth client registration mechanism for an authorization server.

The modern priority is pre-registration, configured Client ID Metadata
Document, deprecated Dynamic Client Registration, then an actionable error.
A metadata URL is never invented and `application_type` is never inferred.

For modern MCP, pre-registered credentials also require a
`:credential_issuer` configuration value. It is compared exactly with the
discovered authorization-server issuer before any secret reference is
resolved. Client ID Metadata Document identifiers remain portable across
authorization servers.

Existing `client_id`, `client_secret`, and `client_metadata_url` keys remain
accepted as compatibility aliases for the explicit `:client_registration`
option.

# `application_type`

```elixir
@type application_type() :: :native | :web
```

# `configured_strategy`

```elixir
@type configured_strategy() ::
  :auto | {:pre_registered, String.t(), secret_ref()} | {:cimd, String.t()}
```

# `secret_ref`

```elixir
@type secret_ref() ::
  nil
  | String.t()
  | {:env, String.t()}
  | (-&gt; String.t() | nil | {:ok, String.t() | nil} | {:error, term()})
```

# `selection`

```elixir
@type selection() :: {:pre_registered, map()} | {:cimd, map()} | {:dynamic, map()}
```

# `select`

```elixir
@spec select(map(), map()) :: {:ok, selection()} | {:error, term()}
```

Selects and validates a registration mechanism without network calls.

---

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