pub async fn validate_and_cache_token<T>(
cache: &Arc<dyn JwksCache>,
token: &str,
jwks_uri: &str,
config: &(impl AuthenticationConfigProvider + Send + Sync),
) -> Result<T, OidcError>Expand description
Validates a JWT token and caches the validation result.
This is the main validation orchestration function that:
- Checks if the token’s claims are already cached
- If not cached, extracts the key ID from the token header
- Retrieves the appropriate JWK (from cache or by fetching JWKS)
- Validates the token and caches the result
§Arguments
cache- The cache implementation to usetoken- The JWT token to validatejwks_uri- The URI where JWKs can be fetchedconfig- Configuration provider for cache TTL settings
§Returns
The validated and deserialized token claims