IAP JWT
Validate and decode Google Cloud Identity-Aware Proxy (IAP) JWTs
Features
- Validate and decode JWTs issued by Google IAP https://cloud.google.com/iap/docs/signed-headers-howto
- Verify JWT signature using public keys from Google retrieved from the JWKS endpoint
- Validate standard claims like
exp,iat,aud,iss - Validate Google-specific claims like
hd(hosted domain) and access levels - Injectable public key retrieval and caching for testability
- Customizable validation options
Installation
Two crypto backends are available via features, aws_lc_rs and rust_crypto (default), exactly one of which must be enabled.
To use aws_lc_rs instead:
Usage
use ;
let token = "..."; // JWT token from IAP
// reqwest Client implements iap_jwt::PublicKeySource with `reqwest` feature enabled (enabled by default)
let client = new;
let config = new
.with_google_hosted_domain
.with_access_levels;
let claims = config.decode_and_validate.await?;
println!;
License
This project is licensed under either of the following licenses, at your option:
- Apache-2.0
- MIT