1
A
回答
0
您可以使用匿名過濾器。事情是這樣的:
<bean id="anonymousAuthFilter"
class="org.springframework.security.web.authentication.AnonymousAuthenticationFilter">
<property name="key" value="foobar"/>
<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
</bean>
<bean id="anonymousAuthenticationProvider"
class="org.springframework.security.authentication.AnonymousAuthenticationProvider">
<property name="key" value="foobar"/>
</bean>
再檢查這樣的:
<sec:authorize access="hasAnyRole('ROLE_ANONYMOUS')">
在這裏你可以找到更多的信息: https://docs.spring.io/spring-security/site/docs/3.0.x/reference/anonymous.html
1
此代碼用戶是否登錄或沒有,作品當使用匿名驗證時:
<sec:authorize access="isAuthenticated()">
<!-- if user is authenticated-->
</sec:authorize>
<sec:authorize access="!isAuthenticated()">
<!-- if user is not authenticated-->
</sec:authorize>
相關問題
- 1. x509身份驗證與Active安全使用彈簧安全
- 2. 彈簧安全預先驗證的用戶登錄
- 3. 彈簧安全不認證
- 4. 彈簧安全2.0彈簧安全3.0
- 5. 身份驗證使用彈簧安全 - 預認證方案
- 6. 彈簧安全
- 7. 使用彈簧安全與彈簧批
- 8. 如何與彈簧安全認證規則數據庫用戶
- 9. 彈簧驗證
- 10. 使用彈簧安全禁用基本身份驗證ldap
- 11. 彈簧數據安全與彈簧安全 - 找到所有當前用戶
- 12. 彈簧安全用戶協議頁面
- 13. 彈簧安全錯誤登錄用戶
- 14. grails彈簧安全創建用戶
- 15. Log4j寫入彈簧安全用戶名
- 16. 顯示登錄用戶彈簧安全
- 17. 使用kerberos/spnego身份驗證的彈簧安全性
- 18. ldap使用彈簧安全性的身份驗證
- 19. 更改用彈簧安全驗證舊密碼的密碼錶
- 20. 用戶登錄驗證使用彈簧安全性的任何url
- 21. 彈簧安全定製Authenticator在彈簧/彈簧安全版本升級後未被調用
- 22. Neo4j彈簧安全
- 23. 彈簧安全表
- 24. x509彈簧安全認證2.0.4
- 25. Grails彈簧安全插件AJAX認證
- 26. 嘲笑認證彈簧安全
- 27. Grails彈簧安全3現場認證
- 28. 使用彈簧安全
- 29. 彈簧驗證器
- 30. Angular2與彈簧靴和彈簧安全