类 JwtTokenManager


  • @Component
    public class JwtTokenManager
    extends com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>
    JWT token manager.
    作者:
    wfnuser, nkorange
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.String createToken​(java.lang.String userName)
      Create token.
      java.lang.String createToken​(org.springframework.security.core.Authentication authentication)
      Create token.
      org.springframework.security.core.Authentication getAuthentication​(java.lang.String token)
      Get auth Info.
      long getTokenValidityInSeconds()  
      void onEvent​(com.alibaba.nacos.common.event.ServerConfigChangeEvent event)  
      private void processProperties()  
      java.lang.Class<? extends com.alibaba.nacos.common.notify.Event> subscribeType()  
      void validateToken​(java.lang.String token)
      validate token.
      • 从类继承的方法 com.alibaba.nacos.common.notify.listener.Subscriber

        executor, ignoreExpireEvent, scopeMatches
      • 从类继承的方法 java.lang.Object

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

      • AUTHORITIES_KEY

        private static final java.lang.String AUTHORITIES_KEY
        另请参阅:
        常量字段值
      • tokenValidityInSeconds

        private volatile long tokenValidityInSeconds
        Token validity time(seconds).
      • jwtParser

        private volatile io.jsonwebtoken.JwtParser jwtParser
      • secretKey

        private volatile javax.crypto.SecretKey secretKey
    • 构造器详细资料

      • JwtTokenManager

        public JwtTokenManager()
    • 方法详细资料

      • processProperties

        private void processProperties()
      • createToken

        public java.lang.String createToken​(org.springframework.security.core.Authentication authentication)
        Create token.
        参数:
        authentication - auth info
        返回:
        token
      • createToken

        public java.lang.String createToken​(java.lang.String userName)
        Create token.
        参数:
        userName - auth info
        返回:
        token
      • getAuthentication

        public org.springframework.security.core.Authentication getAuthentication​(java.lang.String token)
        Get auth Info.
        参数:
        token - token
        返回:
        auth info
      • validateToken

        public void validateToken​(java.lang.String token)
        validate token.
        参数:
        token - token
      • getTokenValidityInSeconds

        public long getTokenValidityInSeconds()
      • onEvent

        public void onEvent​(com.alibaba.nacos.common.event.ServerConfigChangeEvent event)
        指定者:
        onEvent 在类中 com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>
      • subscribeType

        public java.lang.Class<? extends com.alibaba.nacos.common.notify.Event> subscribeType()
        指定者:
        subscribeType 在类中 com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>