类 TokenManagerDelegate
- java.lang.Object
-
- com.alibaba.nacos.plugin.auth.impl.token.TokenManagerDelegate
-
- 所有已实现的接口:
TokenManager
@Component public class TokenManagerDelegate extends java.lang.Object implements TokenManager
token manager delegate.- 作者:
- majorhe
-
-
字段概要
字段 修饰符和类型 字段 说明 private CachedJwtTokenManagercachedJwtTokenManagerprivate JwtTokenManagerjwtTokenManagerstatic java.lang.StringNACOS_AUTH_TOKEN_CACHING_ENABLEDprivate booleantokenCacheEnabled
-
构造器概要
构造器 构造器 说明 TokenManagerDelegate()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.private TokenManagergetExecuteTokenManager()longgetTokenTtlInSeconds(java.lang.String token)validate token.longgetTokenValidityInSeconds()validate token.voidinit()NacosUserparseToken(java.lang.String token)parse token.voidvalidateToken(java.lang.String token)validate token.
-
-
-
字段详细资料
-
NACOS_AUTH_TOKEN_CACHING_ENABLED
public static final java.lang.String NACOS_AUTH_TOKEN_CACHING_ENABLED
- 另请参阅:
- 常量字段值
-
tokenCacheEnabled
private boolean tokenCacheEnabled
-
jwtTokenManager
@Autowired private JwtTokenManager jwtTokenManager
-
cachedJwtTokenManager
@Autowired private CachedJwtTokenManager cachedJwtTokenManager
-
-
方法详细资料
-
init
@PostConstruct public void init()
-
getExecuteTokenManager
private TokenManager getExecuteTokenManager()
-
createToken
public java.lang.String createToken(org.springframework.security.core.Authentication authentication) throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:TokenManagerCreate token.- 指定者:
createToken在接口中TokenManager- 参数:
authentication- auth info- 返回:
- token
- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- access exception
-
createToken
public java.lang.String createToken(java.lang.String userName) throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:TokenManagerCreate token.- 指定者:
createToken在接口中TokenManager- 参数:
userName- auth info- 返回:
- token
- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- access exception
-
getAuthentication
public org.springframework.security.core.Authentication getAuthentication(java.lang.String token) throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:TokenManagerGet 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从接口复制的说明:TokenManagervalidate 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
从接口复制的说明:TokenManagerparse token.- 指定者:
parseToken在接口中TokenManager- 参数:
token- token- 返回:
- nacos user object
- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- access exception
-
getTokenValidityInSeconds
public long getTokenValidityInSeconds() throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:TokenManagervalidate token.- 指定者:
getTokenValidityInSeconds在接口中TokenManager- 返回:
- token validity in seconds
- 抛出:
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从接口复制的说明:TokenManagervalidate token.- 指定者:
getTokenTtlInSeconds在接口中TokenManager- 参数:
token- token- 返回:
- token ttl in seconds
- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- access exception
-
-