类 JwtTokenManager

  • 所有已实现的接口:
    TokenManager

    @Component
    public class JwtTokenManager
    extends com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>
    implements TokenManager
    JWT token manager.
    作者:
    wfnuser, nkorange
    • 字段详细资料

      • AUTHORITIES_KEY

        @Deprecated
        private static final java.lang.String AUTHORITIES_KEY
        已过时。
        另请参阅:
        常量字段值
      • tokenValidityInSeconds

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

        private final com.alibaba.nacos.auth.config.AuthConfigs authConfigs
    • 构造器详细资料

      • JwtTokenManager

        public JwtTokenManager​(com.alibaba.nacos.auth.config.AuthConfigs authConfigs)
    • 方法详细资料

      • processProperties

        private void processProperties()
      • createToken

        @Deprecated
        public java.lang.String createToken​(org.springframework.security.core.Authentication authentication)
        已过时。
        Create token.
        指定者:
        createToken 在接口中 TokenManager
        参数:
        authentication - auth info
        返回:
        token
      • createToken

        public java.lang.String createToken​(java.lang.String userName)
        Create token.
        指定者:
        createToken 在接口中 TokenManager
        参数:
        userName - auth info
        返回:
        token
      • getAuthentication

        @Deprecated
        public org.springframework.security.core.Authentication getAuthentication​(java.lang.String token)
                                                                           throws com.alibaba.nacos.plugin.auth.exception.AccessException
        已过时。
        Get auth Info.
        指定者:
        getAuthentication 在接口中 TokenManager
        参数:
        token - token
        返回:
        auth info
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - access exception
      • validateToken

        public void validateToken​(java.lang.String token)
                           throws com.alibaba.nacos.plugin.auth.exception.AccessException
        validate token.
        指定者:
        validateToken 在接口中 TokenManager
        参数:
        token - token
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - access exception
      • parseToken

        public NacosUser parseToken​(java.lang.String token)
                             throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: TokenManager
        parse token.
        指定者:
        parseToken 在接口中 TokenManager
        参数:
        token - token
        返回:
        nacos user object
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - access exception
      • getTokenTtlInSeconds

        public long getTokenTtlInSeconds​(java.lang.String token)
                                  throws com.alibaba.nacos.plugin.auth.exception.AccessException
        从接口复制的说明: TokenManager
        validate token.
        指定者:
        getTokenTtlInSeconds 在接口中 TokenManager
        参数:
        token - token
        返回:
        token ttl in seconds
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException - access exception
      • getExpiredTimeInSeconds

        public long getExpiredTimeInSeconds​(java.lang.String token)
                                     throws com.alibaba.nacos.plugin.auth.exception.AccessException
        抛出:
        com.alibaba.nacos.plugin.auth.exception.AccessException
      • 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>
      • checkJwtParser

        private void checkJwtParser()