mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 13:32:30 +00:00
Fix Logout in OpenID Sample
Fixes gh-8554
This commit is contained in:
parent
4ab9da1c53
commit
b04b34ba85
@ -16,7 +16,7 @@
|
||||
<intercept-url pattern="/css/*" access="permitAll"/>
|
||||
<intercept-url pattern="/js/*" access="permitAll"/>
|
||||
<intercept-url pattern="/**" access="authenticated"/>
|
||||
<logout/>
|
||||
<logout logout-success-url="/"/>
|
||||
<openid-login login-page="/openidlogin.jsp" user-service-ref="registeringUserService"
|
||||
authentication-failure-url="/openidlogin.jsp?login_error=true">
|
||||
<attribute-exchange identifier-match="https://www.google.com/.*">
|
||||
|
@ -1,3 +1,4 @@
|
||||
<%@ page import="org.springframework.security.web.csrf.CsrfToken" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
|
||||
|
||||
@ -27,6 +28,11 @@ by the application and will be recognized if you return.
|
||||
<p>
|
||||
Your principal object is....: <%= request.getUserPrincipal() %>
|
||||
</p>
|
||||
<p><a href="logout">Logout</a>
|
||||
<% CsrfToken token = (CsrfToken) request.getAttribute(CsrfToken.class.getName()); %>
|
||||
<form id="logout" method="post" action="logout">
|
||||
<input type="hidden" name="<%= token.getParameterName() %>"
|
||||
value="<%= token.getToken() %>"/>
|
||||
</form>
|
||||
<p><a href="#" onclick="document.forms[0].submit()">Logout</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user