public interface AuthenticationManager
3.0| 限定符和类型 | 字段和说明 |
|---|---|
static String |
USER_AUTH_CACHE_NAME |
| 限定符和类型 | 方法和说明 |
|---|---|
Authentication |
authenticate(AuthenticationRequest request)
进行授权操作
|
Authentication |
getByUserId(String userId)
根据用户ID获取权限信息
|
Authentication |
sync(Authentication authentication)
同步授权信息,在调用了
Authentication.setAttribute(String, Serializable)或者
Authentication.setAttributes(Map) 后,需要调用次方法进行同步. |
Authentication authenticate(AuthenticationRequest request)
request - 授权请求Authentication getByUserId(String userId)
userId - 用户IDAuthentication sync(Authentication authentication)
Authentication.setAttribute(String, Serializable)或者
Authentication.setAttributes(Map) 后,需要调用次方法进行同步.
因为如果权限信息不是存在于内存中,而是redis或者其他方案.
在调用了上述方法后,实际的存储值并不会发生改变.
注意: Authentication的实现类应该实现自动同步功能。authentication - 要同步的权限信息Copyright © 2018. All rights reserved.