MCP.OAuth2.Loopback (fnord v0.8.71)
View SourceMinimal loopback HTTP server for OAuth2 Authorization Code callback.
- Binds to 127.0.0.1 on an ephemeral port
- Exposes GET /callback to capture
codeandstate - Delegates token exchange to
MCP.OAuth2.Client.handle_callback/4 - Persists tokens via
MCP.OAuth2.CredentialsStore - Returns a tiny HTML page and stops itself
Summary
Functions
Returns a specification to start this module under a supervisor.
Run the loopback flow until one callback is handled or timeout. Returns the token map on success.
Start the server and return {pid, port} so the caller can construct the redirect_uri.
Start the loopback server on 127.0.0.1:0, returning bound port.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec run( map(), String.t(), String.t(), String.t(), String.t(), non_neg_integer(), non_neg_integer() ) :: {:ok, map()} | {:error, term()}
Run the loopback flow until one callback is handled or timeout. Returns the token map on success.
@spec start(map(), String.t(), String.t(), String.t(), non_neg_integer()) :: {:ok, pid(), non_neg_integer()} | {:error, term()}
Start the server and return {pid, port} so the caller can construct the redirect_uri.
@spec start_link(keyword()) :: GenServer.on_start()
Start the loopback server on 127.0.0.1:0, returning bound port.