默认情况下,登出URL要求POST请求。要对GET请求执行注销,您需要:
http .logout() .logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
或者,如果您想支持
PUT或其他方法,请将其作为参数传递:
http .logout() .logoutRequestMatcher(new AntPathRequestMatcher("/logout", "PUT"));
请参阅文档:http :
//docs.spring.io/spring-
security/site/docs/3.2.4.RELEASE/reference/htmlsingle/(第6.5.3节。注销)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)