类 JwtTokenManager
- java.lang.Object
-
- com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>
-
- com.alibaba.nacos.plugin.auth.impl.JwtTokenManager
-
@Component public class JwtTokenManager extends com.alibaba.nacos.common.notify.listener.Subscriber<com.alibaba.nacos.common.event.ServerConfigChangeEvent>JWT token manager.- 作者:
- wfnuser, nkorange
-
-
字段概要
字段 修饰符和类型 字段 说明 private static java.lang.StringAUTHORITIES_KEYprivate io.jsonwebtoken.JwtParserjwtParserprivate javax.crypto.SecretKeysecretKeyprivate longtokenValidityInSecondsToken validity time(seconds).
-
构造器概要
构造器 构造器 说明 JwtTokenManager()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.lang.StringcreateToken(java.lang.String userName)Create token.java.lang.StringcreateToken(org.springframework.security.core.Authentication authentication)Create token.org.springframework.security.core.AuthenticationgetAuthentication(java.lang.String token)Get auth Info.longgetTokenValidityInSeconds()voidonEvent(com.alibaba.nacos.common.event.ServerConfigChangeEvent event)private voidprocessProperties()java.lang.Class<? extends com.alibaba.nacos.common.notify.Event>subscribeType()voidvalidateToken(java.lang.String token)validate token.
-
-
-
字段详细资料
-
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
-
-
方法详细资料
-
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>
-
-