(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:
- Generate authorization URL
- Open browser (user authorizes)
- Provider redirects to localhost
- Server captures code, exchanges for tokens
- Server shuts down, returns tokens
Exports
oauth-start-callback-serverprocedureStart 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
oauth-run-authorization-flowprocedureRun 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