接口 IAuthenticationManager
public interface IAuthenticationManager
Authentication interface.
- 作者:
- Weizhan▪Yun
-
方法概要
修饰符和类型方法说明authenticate(jakarta.servlet.http.HttpServletRequest httpServletRequest) Authentication of request, identify the user who request the resource.authenticate(String jwtToken) Authentication with jwt.authenticate(String username, String rawPassword) Authentication of user with password.voidauthorize(Permission permission, NacosUser nacosUser) Authorize if the nacosUser has the specified permission.booleanWhether the user exist the administrator role.booleanhasGlobalAdminRole(NacosUser nacosUser) Whether the user has the administrator role.booleanhasGlobalAdminRole(String username) Whether the user has the administrator role.
-
方法详细资料
-
authenticate
Authentication of user with password.- 参数:
username- usernamerawPassword- raw password- 返回:
- user related to this request, null if no user info is found.
- 抛出:
AccessException- if authentication is failed
-
authenticate
Authentication with jwt.- 参数:
jwtToken- json web token- 返回:
- nacos user
- 抛出:
AccessException- if authentication is failed
-
authenticate
NacosUser authenticate(jakarta.servlet.http.HttpServletRequest httpServletRequest) throws AccessException Authentication of request, identify the user who request the resource.- 参数:
httpServletRequest- http servlet request- 返回:
- nacos user
- 抛出:
AccessException- if authentication is failed
-
authorize
Authorize if the nacosUser has the specified permission.- 参数:
permission- permission to authnacosUser- nacosUser who wants to access the resource.- 抛出:
AccessException- if authorization is failed
-
hasGlobalAdminRole
Whether the user has the administrator role.- 参数:
username- nacos user name- 返回:
- if the user has the administrator role.
-
hasGlobalAdminRole
boolean hasGlobalAdminRole()Whether the user exist the administrator role.- 返回:
- if the user exist the administrator role.
-
hasGlobalAdminRole
Whether the user has the administrator role.- 参数:
nacosUser- nacos user name- 返回:
- if the user has the administrator role.
-