-
Notifications
You must be signed in to change notification settings - Fork 6k
RelyingPartyRegistrations typically produces unusable registrationId #15017
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
Thanks, @OrangeDog, for the suggestion. Note that this is covered in the JavaDoc:
Still, I think this would be good to investigate and improve. I wanted to add this context so it's clear why I'm changing the ticket to an enhancement.
Hex encoding might be worth considering. |
The SAML Discovery protocol (which the previous extension implemented) uses a query parameter rather than a path fragment so that entity ids can be transferred safely. Is it possible to do that with the current |
Nice idea. That's not yet supported in the DSL, but you could achieve that by publishing the That said, the Spring Security saml2Login((saml2) -> saml2
.authenticationRequestUri("/saml2/authenticate?entityID={registrationId}") or similar. |
That doesn't seem right. Surely right now you have to build and supply a |
Noting that something like this works great, falling through to the login page nicely to choose a registration. @Override
public MatchResult matcher(HttpServletRequest request) {
String registrationId = request.getParameter("registrationId");
if (new AntPathRequestMatcher("/login").matches(request) && StringUtils.hasText(registrationId)) {
return MatchResult.match(Map.of("registrationId", registrationId));
} else {
return MatchResult.notMatch();
}
} |
@OrangeDog, does your use case, where the entity is a URL parameter, extend to other endpoints (ACS, logout)? I'd prefer to add the support all at once, if so. |
This adds the RelyingPartyRegistrationsDecoder component which allows configuration with signature verification credentials. Closes spring-projectsgh-12116 Closes spring-projectsgh-15017 Closes spring-projectsgh-15090
This adds the RelyingPartyRegistrationsDecoder component which allows configuration with signature verification credentials. Closes spring-projectsgh-12116 Closes spring-projectsgh-15017 Closes spring-projectsgh-15090
This adds the RelyingPartyRegistrationsDecoder component which allows configuration with signature verification credentials. Closes spring-projectsgh-12116 Closes spring-projectsgh-15017 Closes spring-projectsgh-15090
This adds the RelyingPartyRegistrationsDecoder component which allows configuration with signature verification credentials. Closes spring-projectsgh-12116 Closes spring-projectsgh-15017 Closes spring-projectsgh-15090
Describe the bug
Methods such as
RelyingPartyRegistrations.collectionFromMetadataLocation
use theentity
of the asserting party as theregistrationId
.SAML entity IDs are usually URIs (and often a URL to their metadata), and Spring's SAML support (incl. the default login page) requires the
registrationId
to be added to a URL.This typically results in an error when trying to access e.g.
https://relyingparty.com/saml2/authenticate/https://assertingparty.com/SAML/metadata.xml
To Reproduce
Construct a
RelyingPartyRegistrationRepository
usingRelyingPartyRegistrations
without changing the defaultregistrationId
.Expected behavior
registrationId
should always be generated as URL-safe, or should always be escaped when used in a URL.Workaround
Caveat
Using
URLEncoder.encode
to make it safe is not sufficient, as you still get a 400 Bad Request from a default Spring Boot server.The text was updated successfully, but these errors were encountered: