parseTokenResponse
parseTokenResponse(
data,expectedNonce?):TokenSet
Defined in: packages/core/src/token.ts:90
Parses and validates a raw token endpoint response into a TokenSet (RFC 6749 §5.1).
Validates the nonce claim in the ID token when provided (OpenID Connect Core 1.0 §3.1.3.7).
Computes expires_at as an absolute Unix timestamp when expires_in is present.
Parameters
Section titled “Parameters”unknown
The parsed JSON body from the token endpoint response.
expectedNonce?
Section titled “expectedNonce?”string
If provided, the nonce claim in the ID token must match this value.
Returns
Section titled “Returns”A validated TokenSet with computed expires_at.
Throws
Section titled “Throws”OidcError with code TOKEN_EXCHANGE_ERROR if the response is malformed or missing access_token.
Throws
Section titled “Throws”OidcError with code NONCE_MISMATCH if the ID token nonce does not match.