Spring Security Java Config不生成注销URL

Spring Security Java Config不生成注销URL,第1张

Spring Security Java Config不生成注销URL

默认情况下,登出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节。注销)



欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5020782.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存