sigildocs

(sigil oauth server)

(sigil oauth server) - Local HTTP callback server for OAuth flow.

Starts a temporary localhost HTTP server that listens for the OAuth redirect callback, extracts the authorization code, exchanges it for tokens, and returns them.

Enables a CLI-friendly OAuth flow:

  1. Generate authorization URL
  2. Open browser (user authorizes)
  3. Provider redirects to localhost
  4. Server captures code, exchanges for tokens
  5. Server shuts down, returns tokens

Exports

Start a temporary HTTP server that waits for the OAuth callback.

config: oauth-config record expected-state: the state parameter sent in the authorization URL current-time: current unix timestamp

Optional keyword args via opts dict: port: port number (default: 8085) pkce-verifier: PKCE code_verifier for the token exchange

Returns: oauth-tokens record

Run a complete OAuth authorization code flow.

This is the main entry point for CLI-based OAuth. It generates state and PKCE parameters, builds the authorization URL, displays it for the user, starts a local callback server, and returns the tokens after successful authorization.

config: oauth-config record current-time: current unix timestamp Optional keyword args via opts dict: port: callback server port (default: 8085) use-pkce: whether to use PKCE (default: #t) open-browser-fn: (lambda (url) ...) to auto-open the URL