| Crates.io | iap-jwt |
| lib.rs | iap-jwt |
| version | 0.2.0 |
| created_at | 2024-08-09 13:01:43.819867+00 |
| updated_at | 2025-03-11 04:25:38.054005+00 |
| description | Validate and decode Google Cloud Identity-Aware Proxy (IAP) JWTs |
| homepage | |
| repository | https://github.com/ryo33/iap-jwt |
| max_upload_size | |
| id | 1330844 |
| size | 76,177 |
Validate and decode Google Cloud Identity-Aware Proxy (IAP) JWTs
exp, iat, aud, isshd (hosted domain) and access levelscargo add iap-jwt
use iap_jwt::{ValidationConfig};
let token = "..."; // JWT token from IAP
// reqwest Client implements iap_jwt::PublicKeySource with `reqwest` feature enabled (enabled by default)
let client = reqwest::Client::new();
let config = ValidationConfig::new(["/projects/1234567890/global/backendServices/test-service-id"])
.with_google_hosted_domain(["example.com"])
.with_access_levels(["ADMIN"]);
let claims = config.decode_and_validate(token, &client).await?;
println!("Authenticated user: {}", claims.sub);
This project is licensed under either of the following licenses, at your option: