README.adoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. = SAML 2.0 Login & Logout Sample
  2. This guide provides instructions on setting up this SAML 2.0 Login & Logout sample application.
  3. It uses https://simplesamlphp.org/[SimpleSAMLphp] as its asserting party.
  4. The sample application uses Spring Boot and the `spring-security-saml2-service-provider`
  5. module which is new in Spring Security 5.2.
  6. The https://docs.spring.io/spring-security/site/docs/5.6.0-SNAPSHOT/reference/html5/#servlet-saml2login-logout[SAML 2.0 Logout feature] is new in Spring Security 5.6.
  7. == Goals
  8. === SAML 2.0 Login
  9. `saml2Login()` provides a very simple implementation of a Service Provider that can receive a SAML 2.0 Response via the HTTP-POST and HTTP-REDIRECT bindings against the SimpleSAMLphp SAML 2.0 reference implementation.
  10. The following features are implemented in the MVP:
  11. 1. Receive and validate a SAML 2.0 Response containing an assertion, and create a corresponding authentication in Spring Security
  12. 2. Send a SAML 2.0 AuthNRequest to an Identity Provider
  13. 3. Provide a framework for components used in SAML 2.0 authentication that can be swapped by configuration
  14. 4. Work against the SimpleSAMLphp reference implementation
  15. === SAML 2.0 Single Logout
  16. `saml2Logout()` supports RP- and AP-initiated SAML 2.0 Single Logout via the HTTP-POST and HTTP-REDIRECT bindings against the SimpleSAMLphp SAML 2.0 reference implementation.
  17. On this sample, the SAML 2.0 Logout is using the HTTP-POST binding.
  18. You can refer to the https://docs.spring.io/spring-security/site/docs/5.6.0-SNAPSHOT/reference/html5/#servlet-saml2login-logout[reference documentation] for more details about the RP- and AP-initiated SAML 2.0 Logout.
  19. == Run the Sample
  20. === Start up the Sample Boot Application
  21. ```
  22. ./gradlew :spring-security-samples-boot-saml2login:bootRun
  23. ```
  24. === Open a Browser
  25. http://localhost:8080/
  26. You will be redirect to the SimpleSAMLphp IDP
  27. === Type in your credentials
  28. ```
  29. User: user
  30. Password: password
  31. ```