Skip to main content

Module token

Module token 

Source
Expand description

OAuth2 token endpoint operations: authorization-code exchange (with PKCE verifier) and refresh-token rotation.

Structs§

TokenResponse
Parsed response from an OAuth2 token endpoint.
TokenSet
Outcome of a completed token request, with access-token expiry computed in unix milliseconds.

Enums§

TokenError
Errors from token endpoint operations.

Functions§

exchange_code
Exchanges an authorization code for tokens (PKCE verifier required).
refresh
Refreshes an access token with a stored refresh token.
refresh_access_token
Refreshes an access token and returns the raw TokenResponse (rotation-aware: callers read refresh_token off the response).