index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!--
  2. ~ Copyright 2002-2021 the original author or authors.
  3. ~
  4. ~ Licensed under the Apache License, Version 2.0 (the "License");
  5. ~ you may not use this file except in compliance with the License.
  6. ~ You may obtain a copy of the License at
  7. ~
  8. ~ https://www.apache.org/licenses/LICENSE-2.0
  9. ~
  10. ~ Unless required by applicable law or agreed to in writing, software
  11. ~ distributed under the License is distributed on an "AS IS" BASIS,
  12. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. ~ See the License for the specific language governing permissions and
  14. ~ limitations under the License.
  15. -->
  16. <!doctype html>
  17. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
  18. <head>
  19. <title>Spring Security - SAML 2.0 Login & Logout</title>
  20. <meta charset="utf-8" />
  21. <style>
  22. span, dt {
  23. font-weight: bold;
  24. }
  25. </style>
  26. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  27. </head>
  28. <body>
  29. <div class="container">
  30. <ul class="nav">
  31. <li class="nav-item">
  32. <form th:action="@{/logout}" method="post">
  33. <button class="btn btn-primary" id="rp_logout_button" type="submit">
  34. RP-initiated Logout
  35. </button>
  36. </form>
  37. </li>
  38. <li class="nav-item">
  39. <a id="ap_logout_button" class="nav-link" href="https://simplesaml-for-spring-saml.apps.pcfone.io/saml2/idp/SingleLogoutService.php?ReturnTo=http://localhost:8080/login?logout">
  40. AP-initiated Logout
  41. </a>
  42. </li>
  43. </ul>
  44. </div>
  45. <main role="main" class="container">
  46. <h1 class="mt-5">SAML 2.0 Login & Single Logout with Spring Security</h1>
  47. <p class="lead">You are successfully logged in as <span sec:authentication="name"></span></p>
  48. <p class="lead">You're email address is <span th:text="${emailAddress}"></span></p>
  49. <h2 class="mt-2">All Your Attributes</h2>
  50. <dl th:each="userAttribute : ${userAttributes}">
  51. <dt th:text="${userAttribute.key}"></dt>
  52. <dd th:text="${userAttribute.value}"></dd>
  53. </dl>
  54. <h6>Visit the <a href="https://docs.spring.io/spring-security/site/docs/current/reference/html5/#servlet-saml2" target="_blank">SAML 2.0 Login & Logout</a> documentation for more details.</h6>
  55. </main>
  56. </div>
  57. </body>
  58. </html>