You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] OIDC login fails when IdP JWKS contains keys with non-standard use #446
After upgrading from 7.22.x to 7.23.0 (no config changes), every browser login fails on the OIDC callback with KeyParameterError: 'use' must be one of ['sig', 'enc']. Bearer-token API access keeps working.
Our IdP (Zitadel) publishes its SAML keys in the OIDC JWKS (/oauth/v2/keys) next to the signing keys, with use set to saml_ca, saml_response_sig and saml_metadata_sig.
7.23.0 requires authlib>=1.8. Since 1.7, authlib’s AsyncOpenIDMixin.parse_id_token(), which authorize_access_token() calls in routers/auth.py, loads the whole JWKS with joserfc.jwk.KeySet.import_key_set(). joserfc rejects any use outside sig/enc, so one such key fails the entire set.
The id_token is signed with a valid sig key, but verification never reaches it. authlib 1.6.x used authlib.jose.JsonWebKey.import_key_set, which tolerates these keys.
RFC 7517 §4.2 allows other use values (“Other values MAY be used”). joserfc already relaxed the analogous unknown-kty case (authlib/joserfc#103, #104). The same code path is still present in 9.0.3.
What you expected
Login succeeds
Reproduction
Steps, or a minimal configuration that triggers it.
1. Use an IdP whose JWKS contains a key with use other than sig/enc, e.g.: saml_ca, saml_response_sig, etc
2. Log in through the UI: the callback fails.
Environment
mlflow-oidc-auth version: 7.23.0 (worked on 7.22.x with authlib 1.6.x)
Deployment (single replica / multi-replica, behind a proxy?): single replica / multi-replica
Logs
Relevant log output. Redact tokens, secrets, and full JWTs — a JWT payload is base64, not
encryption.
WARNING: OIDC token exchange failed: key_parameter: 'use' must be one of ['sig', 'enc']
ERROR: OIDC token exchange error (joserfc.errors.KeyParameterError): key_parameter: 'use' must be one of ['sig', 'enc']
ERROR: OIDC callback errors: ['Failed to process authentication response']
Thanks for the detailed report — confirmed and reproduced.
joserfc's KeySet.import_key_set only skips keys with an unknown kty; any other unsupported value (here a use outside sig/enc, which RFC 7517 §4.2 explicitly allows) fails the whole set, and authlib's parse_id_token imports the whole set. Bearer tokens kept working because that path imports only the kid-named key.
Fix in #447: the OIDC client now drops JWKs that can't be imported on their own (per RFC 7517 §5) before authlib verifies the id_token, so your signing key is used and the SAML keys are ignored. No key is accepted that wasn't already acceptable, and a set with no usable key still fails closed.
Activity
kharkevich commentedon Oct 6, 2026
Thanks for the detailed report — confirmed and reproduced.
joserfc's
KeySet.import_key_setonly skips keys with an unknownkty; any other unsupported value (here auseoutsidesig/enc, which RFC 7517 §4.2 explicitly allows) fails the whole set, and authlib'sparse_id_tokenimports the whole set. Bearer tokens kept working because that path imports only thekid-named key.Fix in #447: the OIDC client now drops JWKs that can't be imported on their own (per RFC 7517 §5) before authlib verifies the id_token, so your signing key is used and the SAML keys are ignored. No key is accepted that wasn't already acceptable, and a set with no usable key still fails closed.
fix(auth): ignore unusable jwks keys so non-standard use does not bre…