类 AbstractAuthenticationManager

    • 方法详细资料

      • authenticate

        public NacosUser authenticate​(java.lang.String username,
                                      java.lang.String rawPassword)
                               throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: IAuthenticationManager
        Authentication of user with password.
        指定者:
        authenticate 在接口中 IAuthenticationManager
        参数:
        username - username
        rawPassword - raw password
        返回:
        user related to this request, null if no user info is found.
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • authenticate

        public NacosUser authenticate​(java.lang.String token)
                               throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: IAuthenticationManager
        Authentication with jwt.
        指定者:
        authenticate 在接口中 IAuthenticationManager
        参数:
        token - json web token
        返回:
        nacos user
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • authenticate

        public NacosUser authenticate​(javax.servlet.http.HttpServletRequest httpServletRequest)
                               throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: IAuthenticationManager
        Authentication of request, identify the user who request the resource.
        指定者:
        authenticate 在接口中 IAuthenticationManager
        参数:
        httpServletRequest - http servlet request
        返回:
        nacos user
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • authorize

        public void authorize​(com.alibaba.nacos.plugin.auth.api.Permission permission,
                              NacosUser nacosUser)
                       throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: IAuthenticationManager
        Authorize if the nacosUser has the specified permission.
        指定者:
        authorize 在接口中 IAuthenticationManager
        参数:
        permission - permission to auth
        nacosUser - nacosUser who wants to access the resource.
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authorization is failed
      • resolveToken

        private java.lang.String resolveToken​(javax.servlet.http.HttpServletRequest request)
      • hasGlobalAdminRole

        public boolean hasGlobalAdminRole​(java.lang.String username)
        从接口复制的说明: IAuthenticationManager
        Whether the user has the administrator role.
        指定者:
        hasGlobalAdminRole 在接口中 IAuthenticationManager
        参数:
        username - nacos user name
        返回:
        if the user has the administrator role.