-
Notifications
You must be signed in to change notification settings - Fork 6k
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 SAML Service Provider Support #7260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @fhanik, for all your hard work to put this PR together! I've left some feedback inline. I'd also recommend before merging that we add unit tests and java doc.
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
...ngframework/security/saml2/serviceprovider/provider/InMemorySaml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
samples/boot/saml2login/src/main/java/boot/saml2/config/Saml2SampleBootConfiguration.java
Outdated
Show resolved
Hide resolved
samples/boot/saml2login/src/main/java/sample/SecurityConfig.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ngframework/security/saml2/serviceprovider/provider/InMemorySaml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
...org/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRepository.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @fhanik! I provided feedback inline.
...g/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
...g/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
...g/springframework/security/saml2/serviceprovider/provider/Saml2RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/servlet/filter/Saml2LoginPageGeneratingFilter.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I provided some feedback inline
samples/boot/saml2login/src/main/java/sample/Saml2ServiceProviderStarterApplication.java
Outdated
Show resolved
Hide resolved
public static void main(String[] args) { | ||
Log log = LogFactory.getLog(Saml2ServiceProviderStarterApplication.class); | ||
log.info("Starting SAML 2 Sample Application"); | ||
SpringApplication.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to ensure we log a ticket to Boot to ensure it doesn't automatically create a user
2019-08-22 10:25:49.114 INFO 27629 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 801c42c2-5167-4761-80f4-4fd7b3103ba0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is my fault. I left in a test configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
samples/boot/saml2login/src/main/resources/application-multipleidps.yml
Outdated
Show resolved
Hide resolved
samples/boot/saml2login/src/main/resources/application-multipleidps.yml
Outdated
Show resolved
Hide resolved
samples/boot/saml2login/src/main/java/sample/web/SampleSaml2AppController.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/security/saml2/serviceprovider/provider/RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/security/saml2/serviceprovider/provider/RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.security.saml2.serviceprovider.provider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the package to align with OAuth codebase by changing provider to registration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package for oauth resource server is org.springframework.security.oauth2.server.resource
with an anticipated org.springframework.security.oauth2.server.authorization
.
Would it be better to call this org.springframework.security.saml2.provider.service
with an anticipated org.springframework.saml2.provider.identity
? (And subsequently, org.springframework.saml2.provider.service.registration
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
...gframework/security/saml2/serviceprovider/servlet/filter/Saml2LoginPageGeneratingFilter.java
Outdated
Show resolved
Hide resolved
...framework/security/saml2/serviceprovider/servlet/filter/Saml2WebSsoAuthenticationFilter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the last update, @fhanik! I've left some additional feedback inline.
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...amework/security/config/annotation/web/configurers/saml2/Saml2ServiceProviderConfigurer.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...work/security/saml2/serviceprovider/provider/InMemoryRelyingPartyRegistrationRepository.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...va/org/springframework/security/saml2/serviceprovider/provider/RelyingPartyRegistration.java
Outdated
Show resolved
Hide resolved
5ce7c97
to
0b30c14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @fhanik, I've left a bit more feedback inline.
...g/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
Outdated
Show resolved
Hide resolved
...g/springframework/security/config/annotation/web/configurers/saml2/Saml2LoginConfigurer.java
Outdated
Show resolved
Hide resolved
...gframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...ngframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationManager.java
Outdated
Show resolved
Hide resolved
...ngframework/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationManager.java
Outdated
Show resolved
Hide resolved
...ork/security/saml2/serviceprovider/authentication/OpenSamlAuthenticationRequestResolver.java
Outdated
Show resolved
Hide resolved
...framework/security/saml2/serviceprovider/servlet/filter/Saml2WebSsoAuthenticationFilter.java
Outdated
Show resolved
Hide resolved
4d51872
to
0f69330
Compare
dc3043c
to
6ed71c8
Compare
2b5ff9c
to
c5df8d8
Compare
Implements minimal SAML 2.0 login/authentication functionality with the following feature set: - Supports IDP initiated login at the default url of /login/saml2/sso/{registrationId} - Supports SP initiated login at the default url of /saml2/authenticate/{registrationId} - Supports basic java-configuration via DSL - Provides an integration sample using Spring Boot Not implemented with this MVP - Single Logout - Dynamic Service Provider Metadata Fixes spring-projectsgh-6019
c5df8d8
to
e9a44bc
Compare
Simple SAML 2 authentication.