{"repo":"makarski/gauth-rs","free":true,"listed":false,"github":"https://github.com/makarski/gauth-rs","clone":"git clone https://github.com/makarski/gauth-rs.git","description":"Rust Google Oauth2 Client Implementation","language":"Rust","stars":21,"topics":["oauth2-client","google-api","google-oauth2","rust-google","rust","gcp","service-account","google","oauth2"],"license":"Apache-2.0","category":"auth-billing-email","readme_excerpt":"gauth ===== The library supports the following Google Auth flows: OAuth2 for installed apps Service Accounts OAuth2 1. Create your application in Google API Console a. Credentials Create credentials OAuth client ID b. Set application type to Desktop app (Google retired the Other type — Desktop app is the modern equivalent for installed-app flows) c. Enter your application name d. Download JSON configuration of the newly created application Client implementation with defaults It is also possible to make a blocking call to retrieve an access token. This may be helpful if we want to wrap the logic into a closure. Custom app name and handler : access token will be stored in $HOME/.{app name}/access token.json To assign a custom directory as access token caching, set env var value: GAUTH TOKEN DIR Service Account Follow instructions for creating a service account. After a service account key has been created, it can be used to obtain an access token. Loading the key from memory — useful when the credentials live in a database, an environment variable, or are fetched at runtime (no disk write needed): JwtToken::from bytes is also available if you only need the signed JWT and want to drive the token exchange yourself. Token sources with expiry-aware caching (recommended) The source feature provides the v2 token API: a TokenSource fetches one fresh token, and CachingTokenSource adds expiry-aware caching with single-flight refresh — no background task, no empty-string cold reads, and ","default_branch":null,"files":null,"tree":[],"storefront":"/r/makarski","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/makarski/gauth-rs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}