Skip to content

buildTokenRequest

buildTokenRequest(discovery, config, code, codeVerifier): HttpRequest

Defined in: packages/core/src/token.ts:17

Builds an HTTP request to exchange an authorization code for tokens (RFC 6749 §4.1.3).

OidcDiscovery

The OIDC discovery document containing the token endpoint.

OidcConfig

Client configuration (clientId, redirectUri, optional clientSecret).

string

The authorization code received from the authorization endpoint.

string

The PKCE code verifier that matches the code_challenge sent earlier (RFC 7636 §4.5).

HttpRequest

An HttpRequest ready to be sent to the token endpoint.