-
Notifications
You must be signed in to change notification settings - Fork 477
Sample mvp/minimal Review #436
Comments
All feedback incorporated minus the Maven "bom" stuff. |
I reopened this because it appears a few things were missed. I'm adding additional comments and responses too. Saml2AuthenticationProvider
OpenSaml2Implementation
Saml2X509Credential
Saml2ServiceProviderRegistrationWe mentioned a builder, but with the other feedback (simplifying
Saml2IdentityProviderDetails
Saml2AuthenticationToken
build.gradleYou are right. I somehow botched the link to the bom. Please try https://docs.spring.io/spring-security/site/docs/5.1.x/reference/htmlsingle/#gradle-without-spring-boot Sample
|
Duration would be wrong. It's a skew in two different directions. Forward and backwards.
OpenSaml2Implementation initialization is static.
SAML Implementation Guidelines Section 4.3
SAML supports credentials in many forms, DSA, RSA, X509. We have chosen to start with X509.
completed.
completed
typically, you would configure a remote IDP (Saml2IdentityProviderDetails) by specifying a URL to metadata.
no, it should remain entityId. the spec refers to it that way. It just happens that an attribute called issuer, is set to the value of the entityId of the sending entity. There are other attributes set to this value too.
not really. the validation has already taken place at this time.
thank you, I will review this separate. Right now we don't have a build file without boot, but we will once we separate the sample out.
ok. Created
fixed. I separated the initialization of BC completely. |
Why is that wrong? Duration doesn't imply a direction. It is just an amount time (a number plus a unit).
Personally, I think clockSkew is a fine name and conveys the intent much more concisely.
What is the difference between the alias and the entityId? If we don't need it now, let's remove it please.
If it is null, I think we should consider using two separate
Please externalize it so that users can Note this will take some thought as you will need to find a good way to represent the passphrase for the key. Perhaps it will be a new annotation that can provide the passphrase on it.
Thanks. Looking at SampleLook for ways to simplify this configuration. A few ideas:
|
I gave up on the key converters for now. Unlikely will they be injected using @value with a passphrase. I have allowed serviceProviderEntityId to be null, but not removed the configuration. For a complete validation of the incoming message, this should be set, and not derived. I have added the bean definitions as an example. I removed the key converter, because the beans already provide the configured objects. ie, conversion will not be done using
|
First, I think we need to provide something for the keys that works with a passphrase. Perhaps this is just a BeanFactory that takes an InputStream and a passphrase and can output a key. We should move I still have concerns about |
Let's think about that for a second. The keys are no different than OAuth, does our OAuth implementation support pass phrases, or do we simply tell the user remove the pass phrase from the key? The path of least resistance is simply to do that. I'm going to rework the sample to see how this would look.
Will do
The type doesn't matter until we introduce metadata. Then there can be a type. It's very common that the same key/certificate pair is used for both signing and decryption.
|
We don't use private keys for OAuth yet. It is all just public keys, so there are no pass phrases.
So how would we shape this passively once we get there? While it is common that the same key pair is used for signing and encryption, this is generally bad practice so we need to ensure we think about this out of the box. |
I worked with the boot team a little bit on this. There isn't an easy way to map two properties into a single object via a converter. their suggestion was to create an intermediary object, a solution we already have in place
I have added a |
|
Thanks!
followed by
I'll defer this a little bit. and continue to focus on API and configuration portions of the API. |
|
I think we should implement this as it is consistent with other modules (i.e. CAS, OAuth, etc). The logout success would be Is there a reason we need Do we need I know we have gone back and forth on this, but I'm afraid we may have an issue at the moment for Saml2AuthenticationRequestFilter
|
Per: #436 (comment) "I know we have gone back and forth on this, but I'm afraid we may have an issue at the moment for Saml2ServiceProviderRegistration having the getIdentityProviders on it. The problem is that this will not scale if there are very large number of IdPs. We need a lookup based on the alias on a repository interface for the IdP as well."
Per: #436 (comment) "The implementation for getIdpAlias is brittle"
Per: #436 (comment) "I think we should implement this as it is consistent with other modules (i.e. CAS, OAuth, etc)"
Per: #436 (comment) "Do we need RequestUtils or can we use UrlUtils?"
Per: #436 (comment) "Is there a reason we need Saml2AuthenticationFailureHandler? It seems that we could use something more generic? Perhaps SimpleUrlAuthenticationFailureHandler?"
Per: #436 (comment) "Can we simplify sendAuthenticationRequest so that manual encoding isn't done but instead UriComponentsBuilder encodes the parameters?"
Implemented. Modeled after oauth2Login. 44ad0f6
Completed. b2c67f5
Completed. 20e5188
Completed. e5d43ac
Completed. d26ffba
Completed. da94a09
Completed. 689f9ed |
Having |
|
and as a result, we've added a POJO to convey the intention of creating a SAML2
|
|
Ready for review. https://github.com/spring-projects/spring-security-saml/commits/mvp/minimal
Fixed. 0ff0e6a
Fixed. 688acac
Fixed . cd058a9
I implemented an interface, Saml2RequestMatcher in commit 300da8e that allows the matching for the filter to trigger as well as extraction of the alias. The alias doesn't have to be URL based, thus a resolver makes sense. |
I don't like having a specialized Saml2RequestMatcher interface as it is very specific for something that is quite general. I think you should look into working on spring-projects/spring-security#7148 and leveraging it. I also think things are ready for @jzheaux to put another set of eyes on it. After your changes you can also start preparing the changes to be added to Spring Security proper in a new module within saml2/service-provider |
This was merged into Spring Security via spring-projects/spring-security@e9a44bc, so I'm closing this issue. |
= Saml2AuthenticationProvider
= OpenSaml2Implementation
= Saml2AuthenticationToken
= Saml2KeyPair
java.security.KeyPair
= Saml2ServiceProviderRegistration
= build.grade
Update the syntax to align with spring security for build.gradle
Fr example, in https://github.com/spring-projects/spring-security-saml/blob/2a0bbb837cb949ef999d44d30cb8d134fa3abe79/build.gradle it should use something like:
Also for dependencies like Spring Security that have a bom, the bom should be used with the dependency management plugin to avoid needing to specify the version for all the dependencies. For example https://docs.spring.io/spring-security/site/docs/5.0.x/reference/htmlsingle/#gradle-without-spring-boot
The text was updated successfully, but these errors were encountered: