index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
  3. <head>
  4. <title>Spring Security - OAuth 2.0 Login</title>
  5. <meta charset="utf-8" />
  6. </head>
  7. <body>
  8. <div style="float: right" th:fragment="logout" sec:authorize="isAuthenticated()">
  9. <div style="float:left">
  10. <span style="font-weight:bold">User: </span><span sec:authentication="name"></span>
  11. </div>
  12. <div style="float:none">&nbsp;</div>
  13. <div style="float:right">
  14. <form action="#" th:action="@{/logout}" method="post">
  15. <input type="submit" value="Logout" />
  16. </form>
  17. </div>
  18. </div>
  19. <h1>OAuth 2.0 Login with Spring Security</h1>
  20. <div>
  21. You are successfully logged in <span style="font-weight:bold" th:text="${userName}"></span>
  22. via the OAuth 2.0 Client <span style="font-weight:bold" th:text="${clientName}"></span>
  23. </div>
  24. <div>&nbsp;</div>
  25. <div>
  26. <span style="font-weight:bold">User Attributes:</span>
  27. <ul>
  28. <li th:each="userAttribute : ${userAttributes}">
  29. <span style="font-weight:bold" th:text="${userAttribute.key}"></span>: <span th:text="${userAttribute.value}"></span>
  30. </li>
  31. </ul>
  32. </div>
  33. </body>
  34. </html>