类 NacosAuthManager


  • @Component
    public class NacosAuthManager
    extends java.lang.Object
    Builtin access control entry of Nacos.
    从以下版本开始:
    1.2.0
    作者:
    nkorange
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void auth​(com.alibaba.nacos.plugin.auth.api.Permission permission, User user)
      Authorization of request, constituted with resource and user.
      private NacosUser getNacosUser​(java.lang.String token)  
      (专用程序包) User login​(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)  
      User login​(java.lang.Object request)
      Authentication of request, identify the user who request the resource.
      private java.lang.String resolveToken​(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)  
      private java.lang.String resolveToken​(javax.servlet.http.HttpServletRequest request)
      Get token from header.
      private java.lang.String resolveTokenFromUser​(java.lang.String userName, java.lang.String rawPassword)  
      private void validate0​(java.lang.String token)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • authenticationManager

        @Autowired
        private org.springframework.security.authentication.AuthenticationManager authenticationManager
    • 构造器详细资料

      • NacosAuthManager

        public NacosAuthManager()
    • 方法详细资料

      • login

        public User login​(java.lang.Object request)
                   throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authentication of request, identify the user who request the resource.
        参数:
        request - where we can find the user information
        返回:
        user related to this request, null if no user info is found.
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - if authentication is failed
      • login

        User login​(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)
            throws com.alibaba.nacos.plugin.auth.exception.AccessException
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • auth

        public void auth​(com.alibaba.nacos.plugin.auth.api.Permission permission,
                         User user)
                  throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Authorization of request, constituted with resource and user.
        参数:
        permission - permission to auth
        user - user 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)
                                       throws com.alibaba.nacos.plugin.auth.exception.AccessException
        Get token from header.
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • resolveToken

        private java.lang.String resolveToken​(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)
                                       throws com.alibaba.nacos.plugin.auth.exception.AccessException
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • resolveTokenFromUser

        private java.lang.String resolveTokenFromUser​(java.lang.String userName,
                                                      java.lang.String rawPassword)
                                               throws com.alibaba.nacos.plugin.auth.exception.AccessException
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • validate0

        private void validate0​(java.lang.String token)
                        throws com.alibaba.nacos.plugin.auth.exception.AccessException
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • getNacosUser

        private NacosUser getNacosUser​(java.lang.String token)