# `WardrikOAuth.Registration`

Makes Wardrik a client of an authorization server it has no `client_id` for.

This happens once. The client is kept in the store for every node.

  1. If the server reads Client ID Metadata Documents and `page` is `https`, the `client_id` is
     `{page}/client`. Nothing is registered.
  2. Otherwise, Wardrik registers itself at the server's `registration_endpoint` (RFC 7591).
  3. If neither is possible, it returns `{:error, {:no_client, name}}`.

# `client`

```elixir
@spec client(map(), WardrikOAuth.Provider.t(), WardrikOAuth.Metadata.t()) ::
  {:ok, WardrikOAuth.Provider.t()} | {:error, term()}
```

Returns `provider` with a client: its own, the one kept, or one registered now.

# `document`

```elixir
@spec document(map()) :: map()
```

Returns the Client ID Metadata Document served at `{page}/client`.

# `forget`

```elixir
@spec forget(map(), String.t()) :: :ok | {:error, term()}
```

Deletes the client registered for the provider `name`.

# `registered`

```elixir
@spec registered(map(), WardrikOAuth.Provider.t()) :: WardrikOAuth.Provider.t()
```

Returns `provider` with the client kept for it, if there is one.

---

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