7 releases (4 breaking)
| 0.5.3 | Feb 23, 2026 |
|---|---|
| 0.5.2 | Jan 13, 2026 |
| 0.4.0 | Feb 27, 2025 |
| 0.3.0 | Feb 14, 2025 |
| 0.1.2 | Jan 26, 2024 |
#412 in Authentication
8,349 downloads per month
39KB
790 lines
jwks
Fetch and parse JSON Web Key Set (JWKS)
cargo add jwks
Usage
Basic Usage
From a jwks url:
let jwks_url = "https://www.googleapis.com/oauth2/v3/certs";
let jwks = Jwks::from_jwks_url(jwks_url).await.unwrap();
From a openid config url:
let openid_config_url = "https://accounts.google.com/.well-known/openid-configuration";
let jwks = Jwks::from_oidc_url(openid_config_url).await.unwrap();
JWT Validation
For a complete example of using this library with jsonwebtoken to validate JWTs, see the examples/jwt_validation.rs file.
Running Examples
You can run the examples with:
# Basic usage example
cargo run --example basic_usage
# JWT validation example
cargo run --example jwt_validation
Dependencies
~20–48MB
~851K SLoC