-
Notifications
You must be signed in to change notification settings - Fork 6k
RelyingPartyRegistrationResolvers should allow for the registration id to be specified #9486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related to #9133 |
The original impetus for this ticket is #8731 and since it has been reopened for additional research, we'll reopen this one as well, just in case changes there require changes here. |
The introduction of this interface breaks passivity in a fairly isolated way. If an application constructs a Converter<HttpServletRequest, RelyingPartyRegistration> registrationResolver =
new DefaultRelyingPartyRegistrationResolver(registrations);
Saml2MetadataResolver metadataResolver = myMetadataResolver();
Saml2MetadataFilter filter = new Saml2MetadataFilter(registrationResolver, metadataResolver); Then there will be no issue when updating to the latest. However, if the construction of Saml2MetadataResolver metadataResolver = myMetadataResolver();
Saml2MetadataFilter filter = new Saml2MetadataFilter(
new DefaultRelyingPartyRegistrationResolver(registrations),
metadataResolver); Then which constructor to be used is ambiguous since The resolution is to place the construction of RelyingPartyRegistrationResolver registrationResolver = new DefaultRelyingPartyRegistrationResolver(registrations)
Saml2MetadataResolver metadataResolver = myMetadataResolver();
Saml2MetadataFilter filter = new Saml2MetadataFilter(registrationResolver, metadataResolver); |
There are are number of higher-level SAML 2.0 components that derive the registration id from the request. Examples include
Saml2MetadataFilter
,Saml2WebSsoAuthenticationFilter
, andSaml2WebSsoAuthenticationRequestFilter
, with more to come in the future.On each request, RelyingPartyRegistrationResolver re-derives the registration id and usually needs to use an equivalent strategy. This complexifies some use cases since it then requires the derivation strategy in the resolver to sync up with the strategy in the higher-level component.
For example, by default the SAML 2.0 Response endpoint is configured to be
/login/saml2/sso/{registrationId}
inSaml2WebSsoAuthenticationFilter
. Since the default resolver only takes anHttpServletRequest
as a parameter, the resolver must re-perform the same request-matching logic in order to derive theregistrationId
for its purposes. Aside from the duplication of effort, this also means that if the application wants to customize the URL to be/{registrationId}/login/saml2/sso
, for example, then it needs to be configured in both places.Like
OAuth2AuthorizationRequestResolver
, these resolvers should allow higher-level components to specify the registration id when they have it, alleviating this duplication of effort.Likely this will require introducing an interface, which should be named
RelyingPartyRegistrationResolver
. Components that use theConverter<HttpServletRequest, RelyingPartyRegistration>
should adapt to this interface and should send any registration id that they have.The text was updated successfully, but these errors were encountered: