public class AbstractAuthenticationManager extends Object implements IAuthenticationManager
| 限定符和类型 | 字段和说明 |
|---|---|
protected TokenManagerDelegate |
jwtTokenManager |
protected NacosRoleServiceImpl |
roleService |
protected NacosUserDetailsServiceImpl |
userDetailsService |
| 构造器和说明 |
|---|
AbstractAuthenticationManager(NacosUserDetailsServiceImpl userDetailsService,
TokenManagerDelegate jwtTokenManager,
NacosRoleServiceImpl roleService) |
| 限定符和类型 | 方法和说明 |
|---|---|
NacosUser |
authenticate(javax.servlet.http.HttpServletRequest httpServletRequest)
Authentication of request, identify the user who request the resource.
|
NacosUser |
authenticate(String token)
Authentication with jwt.
|
NacosUser |
authenticate(String username,
String rawPassword)
Authentication of user with password.
|
void |
authorize(Permission permission,
NacosUser nacosUser)
Authorize if the nacosUser has the specified permission.
|
boolean |
hasGlobalAdminRole(NacosUser nacosUser)
Whether the user has the administrator role.
|
boolean |
hasGlobalAdminRole(String username)
Whether the user has the administrator role.
|
protected NacosUserDetailsServiceImpl userDetailsService
protected TokenManagerDelegate jwtTokenManager
protected NacosRoleServiceImpl roleService
public AbstractAuthenticationManager(NacosUserDetailsServiceImpl userDetailsService, TokenManagerDelegate jwtTokenManager, NacosRoleServiceImpl roleService)
public NacosUser authenticate(String username, String rawPassword) throws AccessException
IAuthenticationManagerauthenticate 在接口中 IAuthenticationManagerusername - usernamerawPassword - raw passwordAccessException - if authentication is failedpublic NacosUser authenticate(String token) throws AccessException
IAuthenticationManagerauthenticate 在接口中 IAuthenticationManagertoken - json web tokenAccessException - if authentication is failedpublic NacosUser authenticate(javax.servlet.http.HttpServletRequest httpServletRequest) throws AccessException
IAuthenticationManagerauthenticate 在接口中 IAuthenticationManagerhttpServletRequest - http servlet requestAccessException - if authentication is failedpublic void authorize(Permission permission, NacosUser nacosUser) throws AccessException
IAuthenticationManagerauthorize 在接口中 IAuthenticationManagerpermission - permission to authnacosUser - nacosUser who wants to access the resource.AccessException - if authorization is failedpublic boolean hasGlobalAdminRole(String username)
IAuthenticationManagerhasGlobalAdminRole 在接口中 IAuthenticationManagerusername - nacos user namepublic boolean hasGlobalAdminRole(NacosUser nacosUser)
IAuthenticationManagerhasGlobalAdminRole 在接口中 IAuthenticationManagernacosUser - nacos user nameCopyright © 2018–2023 Alibaba Group. All rights reserved.