Expand description
HTTP client for Google OAuth2.
This crate covers two Google auth flows:
app— OAuth2 for installed apps. Three-legged flow with a consent URI, auth code exchange, and a refresh-token loop. Tokens are cached on disk so subsequent calls reuse them until they expire.serv_account— Service accounts. JWT-bearer flow for server-to-server auth using a Google-issued JSON key. Tokens are cached in-memory on theServiceAccountinstance.
§Optional features
app-blocking— adds [app::Auth::access_token_blocking], a synchronous wrapper around the async access-token call. Useful when plugging gauth into a synchronous integration point (e.g. a tonic interceptor).token-watcher— adds [token_provider::AsyncTokenProvider], a daemon that periodically refreshes a token in the background and exposes a synchronous read accessor over a shared cache.
See the crate README for usage examples.
Modules§
- app
- OAuth2 for installed apps (three-legged consent flow).
- serv_
account - Service-account JWT-bearer flow for server-to-server auth.