接口 IAuthenticationManager

    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      NacosUser authenticate​(java.lang.String jwtToken)
      Authentication with jwt.
      NacosUser authenticate​(java.lang.String username, java.lang.String rawPassword)
      Authentication of user with password.
      NacosUser authenticate​(javax.servlet.http.HttpServletRequest httpServletRequest)
      Authentication of request, identify the user who request the resource.
      void authorize​(com.alibaba.nacos.plugin.auth.api.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​(java.lang.String username)
      Whether the user has the administrator role.
    • 方法详细资料

      • authenticate

        NacosUser authenticate​(java.lang.String username,
                               java.lang.String rawPassword)
                        throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authentication of user with password.
        参数:
        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

        NacosUser authenticate​(java.lang.String jwtToken)
                        throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authentication with jwt.
        参数:
        jwtToken - json web token
        返回:
        nacos user
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • authenticate

        NacosUser authenticate​(javax.servlet.http.HttpServletRequest httpServletRequest)
                        throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authentication of request, identify the user who request the resource.
        参数:
        httpServletRequest - http servlet request
        返回:
        nacos user
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • authorize

        void authorize​(com.alibaba.nacos.plugin.auth.api.Permission permission,
                       NacosUser nacosUser)
                throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authorize if the nacosUser has the specified permission.
        参数:
        permission - permission to auth
        nacosUser - nacosUser who wants to access the resource.
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authorization is failed
      • hasGlobalAdminRole

        boolean hasGlobalAdminRole​(java.lang.String username)
        Whether the user has the administrator role.
        参数:
        username - nacos user name
        返回:
        if the user has the administrator role.
      • hasGlobalAdminRole

        boolean hasGlobalAdminRole​(NacosUser nacosUser)
        Whether the user has the administrator role.
        参数:
        nacosUser - nacos user name
        返回:
        if the user has the administrator role.