开发者

Spring Security - Is there a way to check if you're in a secured request?

I want to know if开发者_运维问答 the request I am in is accessible anonymously, even if I am authenticated anyways.


I think the easiest idea is to extend AuthenticatedVoter and override its vote() method to save a flag in a thread-local whenever ConfigAttribute happens to be IS_AUTHENTICATED_ANONYMOUSLY. You can then inject your extended AuthenticatedVoter into your Spring Security stack.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜