exitUser.jsp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %>
  2. <%@ page import="org.springframework.security.core.Authentication" %>
  3. <%@ page import="org.springframework.security.core.context.SecurityContextHolder" %>
  4. <%@ page pageEncoding="UTF-8" %>
  5. <html>
  6. <head>
  7. <title>Exit User</title>
  8. </head>
  9. <body>
  10. <h1>Exit User</h1>
  11. <c:if test="${not empty param.login_error}">
  12. <font color="red">
  13. Your 'Exit User' attempt was not successful, try again.<br/><br/>
  14. Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>
  15. </font>
  16. </c:if>
  17. <form action="<c:url value='logout/impersonate'/>" method="POST">
  18. <table>
  19. <tr><td>Current User:</td><td>
  20. <%
  21. Authentication auth = SecurityContextHolder.getContext().getAuthentication();
  22. if (auth != null) { %>
  23. <%= auth.getPrincipal().toString() %>
  24. <% } %>
  25. </td></tr>
  26. <tr><td colspan='2'><input name="exit" type="submit" value="Exit"></td></tr>
  27. </table>
  28. <input type="hidden" name="<c:out value="${_csrf.parameterName}"/>" value="<c:out value="${_csrf.token}"/>"/>
  29. </form>
  30. </body>
  31. </html>