tamer-auth
OAuth 2.0 / PKCE auth flow for Lynx. Depends on tamer-linking and tamer-display-browser.
Overview
- AuthRequest — Build auth URL, prompt user, parse callback
- makeRedirectUri — Create redirect URI for OAuth
- exchangeCodeAsync — Exchange authorization code for tokens
- TokenResponse — Token storage and refresh
Uses PKCE by default. Opens auth URL via openAuthSessionAsync (tamer-display-browser), parses redirect for code and state.
Installation
Run t4l link after installing.
API
AuthRequest
AuthRequestConfig: clientId, redirectUri, scopes?, responseType?, usePKCE?, state?, extraParams?
makeAuthUrlAsync(discovery: AuthDiscoveryDocument): Promise<string>— Build auth URLpromptAsync(discovery): Promise<AuthSessionResult>— Open browser, wait for redirectparseReturnUrl(url)— Parse callback URL for code/state
makeRedirectUri(options?)
Default scheme: tamerdevapp. Default path: auth/callback.
exchangeCodeAsync
Exchange authorization code for tokens. See AuthRequest and TokenResponse types.
TokenResponse
Token storage. See source for methods.
