A feature-rich, highly configurable OpenID Connect ID token verifier in Rust — empowering you to validate ID tokens as easily as this, while handling retries, caching, and more under the hood:
use id_token_verifier::*;
use id_token_verifier::client::*;
#[derive(serde::Deserialize)]
struct MyClaims {
sub: String,
email: Option<String>,
email_verified: Option<bool>,
}
async fn verify(
token: &str,
id_token_verifier: &IdTokenVerifierDefault
) -> Result<MyClaims, IdTokenVerifierError> {
id_token_verifier.verify(token).await
}- 🔁 Configurable JWKS caching, including background refresh.
- 🛠 Pluggable retry logic via backoff_config and backon.
- ⚙️ Flexible validation settings.
- 🧩 serde-friendly configuration — load from config files or environment variables,
or use the provided config
Builders. - 📈 tracing support via the optional tracing
featureflag.
- ✅ Validating Google ID tokens
Includes full setup for retries, JWKS caching, and validation settings.