casPropagateLogoutView.html 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
  6. <title th:text="#{screen.logout.header}">Propagate Logout View</title>
  7. <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
  8. <link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
  9. <script th:src="@{#{webjars.poppermin.js}}"></script>
  10. <script>
  11. $(function () {
  12. $('[data-toggle="tooltip"]').tooltip();
  13. });
  14. </script>
  15. <script th:inline="javascript">
  16. /*<![CDATA[*/
  17. function redirectToApp() {
  18. window.location = [[${logoutRedirectUrl}]];
  19. }
  20. function handleCallback(index, status) {
  21. if (status == 200) {
  22. $('#service' + index).addClass('fa-check').removeClass('fa-question');
  23. $('#service' + index).prop('title', 'Logout request was successfully received.');
  24. } else {
  25. $('#service' + index).addClass('fa-warning').removeClass('fa-question');
  26. $('#service' + index).prop('title', 'Logout notification could not be sent.');
  27. }
  28. }
  29. /*]]>*/
  30. </script>
  31. </head>
  32. <body>
  33. <main role="main" class="container mt-3 mb-3">
  34. <div layout:fragment="content">
  35. <div class="alert alert-success">
  36. <h2 th:utext="#{screen.logout.header}">Logout successful</h2>
  37. <p th:utext="#{screen.logout.fc.success}">You have successfully logged out of the Central Authentication
  38. Service. Given single logout is enabled with CAS, \
  39. the following list of applications are <strong> only notified</strong> to log you out and destroy your
  40. user session. Remember that this \
  41. is just a notification, not a guarantee. It is up the application itself to honor these notifications
  42. and properly take action to log you \
  43. out.</p>
  44. <ol start="a">
  45. <li th:each="entry,iterStat : ${logoutUrls}">
  46. <script type="text/javascript" th:inline="javascript">
  47. /*<![CDATA[*/
  48. $.ajax({
  49. url: [[${entry.key.logoutUrl.toExternalForm()}]],
  50. dataType: 'jsonp',
  51. async: true,
  52. contentType: [[${entry.value.contentType}]]
  53. , data: [[${entry.value.message}]]
  54. , success: function (data) {
  55. var index = [[${iterStat.index}]];
  56. handleCallback(index, 200);
  57. },
  58. error: function (err, textStatus, errorThrown) {
  59. var index = [[${iterStat.index}]];
  60. handleCallback(index, err.status);
  61. }
  62. });
  63. /*]]>*/
  64. </script>
  65. <p>
  66. <i data-toggle="tooltip" data-placement="top" class="fa fa-question"
  67. th:id="${'service'+iterStat.index}" title="Logout request pending..."> </i>
  68. <kbd th:text="${entry.key.service.id}">entry.key.service.id</kbd>
  69. </p>
  70. </li>
  71. </ol>
  72. <p th:utext="#{screen.logout.security}">For security reasons, exit your web browser.</p>
  73. <input type="button" th:if="${logoutRedirectUrl}"
  74. class="btn btn-primary btn-success" onclick="redirectToApp();"
  75. th:value="${'Go to ' + logoutRedirectUrl}" value="Go to...">
  76. </div>
  77. </div>
  78. </main>
  79. </body>
  80. </html>