当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Disable Access if Logged in

问题描述:

I'm using Spring Security. I need to block the access to Login page if user is authenticated. The following line is giving error.

<intercept-url pattern="/user/**" access="!IS_AUTHENTICATED_FULLY" />

Error is unsupported configuration.

网友答案:

either you can use IS_AUTHENTICATED_ANONYMOUSLY (to allow access only if user is authenticated anonymously), or enable expressions and use IsAuthenticated() like given below

<http use-expressions="true">
    <intercept-url pattern="/user/**"
        access="isAuthenticated()"/>
    ...
  </http>
分享给朋友:
您可能感兴趣的文章:
随机阅读: