0
我想讓我的項目中的某些頁面只能被匿名用戶訪問(例如:/ login,/ signup),但由於某種原因,其他角色也能夠訪問它們。(這會讓我失望,因爲實際上其他方式..)Spring Security:如何製作匿名內容?
這是我的HTTP配置:
<http authentication-manager-ref="dao-auth"
access-decision-manager-ref="accessDecisionManager"
disable-url-rewriting="true">
<intercept-url pattern="/pages/usermain.html" access="USER"></intercept-url>
<intercept-url pattern="/pages/home.html" access="USER"></intercept-url>
<intercept-url pattern="/home" access="USER"></intercept-url>
<intercept-url pattern="/logout" access="USER"></intercept-url>
<intercept-url pattern="/login" access="ROLE_ANONYMOUS"></intercept-url>
<intercept-url pattern="/denied" access="ROLE_ANONYMOUS"></intercept-url>
<form-login login-page="/login" authentication-failure-url="/login/bad"
default-target-url="/home"
login-processing-url="/authenticate"
username-parameter="email" password-parameter="password" />
<logout invalidate-session="true" logout-success-url="/"
logout-url="/logout" />
<access-denied-handler error-page="/denied" />
<session-management invalid-session-url="/login">
<concurrency-control max-sessions="1"
expired-url="/login" />
</session-management>
</http>
謝謝!