Jho*_*hon 34 spring spring-security
我正在努力学习弹簧安全性,我有一个疑问:isAuthenticated和isFullyAuthenticated在spring security中有什么区别
smo*_*ers 35
从spring-security文档:
isAuthenticated() Returns true if the user is not anonymous
isFullyAuthenticated() Returns true if the user is not an anonymous or a remember-me user
Run Code Online (Sandbox Code Playgroud)
因此,除了用户成功通过身份验证/登录之外,isFullyAuthenticated()仅验证额外的spring-security"remember-me"功能是否处于非活动状态
Arm*_*oot 11
实际上,我认为他们在AuthenticatedVoter文档中解释得更好:
Authentication将检查当前电流以确定主体是否具有特定级别的认证.在"全"认证选项意味着用户完全认证(即AuthenticationTrustResolver.isAnonymous(认证)是假的 ,并AuthenticationTrustResolver.isRememberMe(认证)是假的.
如果校长通过记住我或者经过完全认证,则"REMEMBERED"将授予访问权限.如果委托人通过记住我,匿名或通过完全身份验证进行身份验证,则"匿名"将授予访问权限.
在他们的文档表中,他们提到:
isAuthenticated()- 如果用户不是匿名用户,则返回true
isFullyAuthenticated()-返回真如果用户是不是匿名 或一个记得,我的用户
| 归档时间: |
|
| 查看次数: |
16723 次 |
| 最近记录: |