Expand description
OAuth 2.0 for native applications (ADR-0015).
Implements the authorization code flow with PKCE, a loopback redirect, token storage in the OS credential store, and transparent refresh.
LoopbackRedirect::bind() → redirect_uri
AuthorizationFlow::begin() → authorization url + state + verifier
Opener::open_url() → the user consents in their browser
RedirectListener::wait() → code (state verified)
AuthorizationFlow::exchange() → TokenSet
TokenStore::save() → OS credential storeAfterwards nothing calls the flow again: AccessTokenProvider hands out a valid
access token and refreshes it when it is about to expire.
Structs§
- Access
Token Provider - Hands out a valid access token, refreshing when needed.
- Authorization
Code - The authorization code handed back by the provider, after
statewas verified. - Authorization
Flow - The OAuth 2.0 authorization code flow with PKCE.
- OAuth
Config - Everything needed to talk to one OAuth provider.
- Pending
Authorization - A flow that has been started but not yet completed.
- Pkce
- Proof Key for Code Exchange (RFC 7636), S256 only.
- Token
Set - The credentials of one authenticated account.
- Token
Store - Credentials in the OS credential store, one entry per account (ADR-0016).
Traits§
- Redirect
Listener - Receives the provider’s redirect.