#[non_exhaustive]pub enum AudienceValidationMode {
Permissive,
Warn,
Strict,
}Expand description
How the resource server treats azp when validating JWT audience.
Background. RFC 9068 §4 + OIDC Core §2 establish aud as the
authoritative resource-server claim and azp as the authorized-party
(client) claim. Some OAuth deployments — typically when the MCP server
acts as both OAuth client and resource server (the documented
OAuthProxyConfig topology) — issue tokens where the configured
audience appears only in azp. This enum lets operators decide
whether that historic compatibility fallback is honored, surfaced via
a one-shot warning, or refused.
Default: AudienceValidationMode::Strict — rejects azp-only
matches so a token whose configured audience appears only in azp
is refused. To keep the previous azp-accepting behavior, set
audience_validation_mode = "warn" (one-shot warning per process) or
"permissive" (silent).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Permissive
Accept aud matches and azp-only matches silently. Pre-1.7
behavior. Use only when the IdP cannot be reconfigured to
populate aud.
Warn
Accept aud matches silently. Accept azp-only matches with a
one-shot tracing::warn! per process. Reject neither.
Strict
Accept only aud matches. Reject azp-only matches as audience
mismatch. Default — recommended for new deployments and any
IdP that can be configured to populate aud reliably.
Trait Implementations§
Source§impl Clone for AudienceValidationMode
impl Clone for AudienceValidationMode
Source§fn clone(&self) -> AudienceValidationMode
fn clone(&self) -> AudienceValidationMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more