Repository navigation
Description
Enhancement Description
Validate the AuthnContextClassRef returned in the SAML Response from a brokered SAML identity provider against the authnContextClassRefs configured on the identity provider, honoring the configured comparison type. Today Keycloak sends the configured authnContextClassRefs in the outbound AuthnRequest, but the broker endpoint accepts any class reference in the response.
Value Proposition
An identity provider that returns a weaker authentication context than requested (for example unspecified instead of an MFA class) is currently accepted without notice. Validating the response allows administrators to rely on the requested authentication level when brokering.
Goals
- Reject a SAML Response whose
AuthnContextClassRefdoes not satisfy the configuredauthnContextClassRefsand comparison type. - Leave identity providers without configured
authnContextClassRefsunaffected.
Non-Goals
- Mapping levels of authentication between the incoming request and the brokered request (see Document that there is no integration between brokering and LoA #55108).
- Integration of brokering with step-up authentication for OIDC.
Discussion
No response
Notes
Related to #55108, which documents that brokering is not integrated with LoA and announces a follow-up enhancement. A first proposal exists in #50044, which changes SAMLEndpoint. Open points: behavior for comparison types other than exact (minimum, maximum, better), and whether this needs a backwards-compatibility switch as it can reject logins that work today.
Metadata
Metadata
Assignees
Labels
Type
Fields
Value
Effort
Votes
Projects
- StatusShow more project fieldsOpen
Activity
mjatin2007 commentedon Nov 17, 2026
Thanks for opening this, @ahus1. As offered on #50044, I’m happy to help with a replacement PR alongside @danSayag and the original team. Is anyone already taking this forward, and what scope would you prefer for the first PR given the comparison and compatibility questions?