FastestMCP.Client.OAuth.AuthorizationHandler behaviour (fastest_mcp v0.2.0)

Copy Markdown View Source

Host boundary for interactive OAuth authorization.

FastestMCP constructs and validates the authorization request. The host is responsible for presenting or opening authorization_url and returning the final redirect URI (or its code and state values). FastestMCP does not provide browser or authorization-server UI.

Structured responses must also include redirect_uri, containing the final redirect endpoint observed by the host, so FastestMCP can validate it before exchanging the authorization code.

Summary

Types

response()

@type response() ::
  {:ok, String.t()}
  | {:ok, %{code: String.t(), state: String.t(), redirect_uri: String.t()}}
  | {:ok, %{required(String.t()) => String.t()}}
  | {:error, term()}

Callbacks