# `Lockspire.Clients`

Durable client registration API for secure client onboarding.

# `error_detail`

```elixir
@type error_detail() :: %{field: atom(), reason: validation_error(), detail: term()}
```

# `validation_error`

```elixir
@type validation_error() ::
  :invalid_client_type
  | :invalid_token_endpoint_auth_method
  | :invalid_token_endpoint_auth_signing_alg
  | :invalid_redirect_uri
  | :invalid_logout_uri
  | :invalid_scope
  | :invalid_grant_type
  | :invalid_response_type
  | :incoherent_pair
  | :missing_cryptographic_material
  | :mutually_exclusive_with_jwks_uri
  | :invalid_uri_scheme
  | :pkce_required
  | :client_secret_not_allowed
  | :persistence_failed
```

# `frontchannel_logout_origin_matches_redirect_uri?`

```elixir
@spec frontchannel_logout_origin_matches_redirect_uri?(String.t(), [String.t()]) ::
  boolean()
```

# `generate_client_id`

```elixir
@spec generate_client_id() :: String.t()
```

# `register_client`

```elixir
@spec register_client(map() | keyword()) ::
  {:ok, Lockspire.Clients.RegistrationResult.t()} | {:error, [error_detail()]}
```

# `rotate_secret_hash`

```elixir
@spec rotate_secret_hash() :: {String.t(), String.t()}
```

# `rotate_secret_material`

```elixir
@spec rotate_secret_material(keyword()) :: %{
  client_secret: String.t(),
  client_secret_hash: String.t(),
  client_secret_jwt_verifier_encrypted: String.t()
}
```

# `validate_allowed_scopes`

```elixir
@spec validate_allowed_scopes([String.t()] | String.t() | nil) ::
  :ok | {:error, [error_detail()]}
```

# `validate_logout_uri`

```elixir
@spec validate_logout_uri(String.t() | nil) :: :ok | {:error, error_detail()}
```

# `validate_redirect_uris`

```elixir
@spec validate_redirect_uris([String.t()] | String.t() | nil) ::
  :ok | {:error, [error_detail()]}
```

---

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