-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add AssertingPartyMetadataRepository #15349
Conversation
@OrangeDog will you please take a look at this PR and see if it addresses the use cases you described in #15090, #15017, and #15018 (related to #12116)? |
|
I've tested what I'm using (see above) and it's definitely an improvement 👍 . Please make For the signing, perhaps it should always use the filter, but with an empty/system trust store if none is provided. Then when decoding, set
Rather than parse a query string template, perhaps a method that just takes the parameter name would be better?
or
|
I think what may be better than this is enhancing |
I don't care where that code is, as long as I can get at it without reflection hacks during my |
320a303
to
1206435
Compare
Thanks for all the feedback and insight, @OrangeDog. I'm enjoying this collaboration with you. Specifically, your comments about
I'd like to keep the placeholder there as I think a nice feature one day would be to allow for other placeholders that are already supported in other parts of Spring Security like .authenticationRequestUri("/saml2/authenticate", "registrationId={registrationId}") Such just didn't seem to buy very much since I'm already parsing the
I'd prefer to leave the defaults as they are, which means that if no credentials are provided, then no signature verification is performed. This is also what I disagree that this is a CVE on the grounds that HTTPS is the standard for secure endpoints across Spring Security. When deviating from that standard, Security tries to make the secure option the easy one. But going further than that, we can easily get in the way -- for example. it's not true that every HTTP endpoint requires trust material as |
Also, in the meantime, I've addressed #15090 in the way we already discussed and committed that to |
1206435
to
51a60a4
Compare
Very interesting. I'll have a deeper look at that... Yes, that looks like it would work for common cases. Though I don't think it should be described as "expiry aware", because that entirely depends on the For the default one your builder constructs, you may want to pass your own I'm using custom
Not in SAML. That's why everything has XML-level signatures and optional encryption.
That may be true, but disabling security should be a conscious choice by the developer, not the default. |
...k/security/saml2/provider/service/registration/OpenSamlAssertingPartyMetadataRepository.java
Show resolved
Hide resolved
...g/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
...k/security/saml2/provider/service/registration/OpenSamlAssertingPartyMetadataRepository.java
Outdated
Show resolved
Hide resolved
51a60a4
to
f7e9566
Compare
a7d40fd
to
70a54e1
Compare
70a54e1
to
a5bd4ae
Compare
- Use test objects - Ensure assertThat is checked Issue spring-projectsgh-11725
366ab7e
to
6a5eb3b
Compare
I think this needs more test coverage, in particular the parts that didn't work that I pointed out above. |
This PR introduces
OpenSamlAssertingPartyMetadataRepository
, a class that makes what is otherwise hidden behindRelyingPartyRegistrations
configurable. For example, before this change, you would do:With this change, you can do:
or
or
followed by:
OpenSamlAssertingPartyMetadataRepository
uses an underlyingMetadataResolver
to refresh the metadata in an expiry-aware fashion. This can be used to back aRelyingPartyRegistrationRepository
like so: