Registry / auth / yup-oauth2

yup-oauth2

JSON →
library12.1.2rscratesunverified

An oauth2 implementation providing the 'device', 'service account' and 'installed' authorization flows.

# Cargo.toml [dependencies] yup-oauth2 = "12.1.2"
INSTALL
IMPORT
SIG · YUP-OAUTH2
Y
yup-oauth2
authrustv12.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceAccountAuthenticator
use yup_oauth2::ServiceAccountAuthenticator;

Authenticate using a Google service account JSON key file and obtain an access token.

use yup_oauth2::ServiceAccountAuthenticator; async fn authenticate() -> Result<(), Box<dyn std::error::Error>> { let sa = ServiceAccountAuthenticator::new("path/to/service-account.json").await?; let token = sa.token(&["https://www.googleapis.com/auth/cloud-platform"]).await?; println!("Access token: {}", token.as_str()); Ok(()) }
Debug
Known issues
gotchaRequires a Tokio runtime for async operations
fix
Add tokio as a dependency and use #[tokio::main] or similar runtime
affects: >=12.0.0
Upgrade
Version history
12.1.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
56 hits · last 30 days
node
48
Amazon
1
Resources
yup-oauth2 — cargo add yup-oauth2 · libregistry