类 NacosClientAuthServiceImpl
java.lang.Object
com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService
com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl
- 所有已实现的接口:
Closeable,ClientAuthService
a ClientAuthService implement.
- 作者:
- wuyfee
-
字段概要
字段修饰符和类型字段说明private longLast timestamp refresh security info from server.private LoginIdentityContextA context to take with when sending request to Nacos server.private final longRe-login window in milliseconds.private static final org.slf4j.Loggerprivate longtime window to refresh security info in seconds.private longTTL of token in seconds.从类继承的字段 com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService
nacosRestTemplate, serverList -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明longgenerateTokenRefreshWindow(long tokenTtl) Randomly generate TokenRefreshWindow, Avoid a large number of logins causing pressure on the Nacos server.getLoginIdentityContext(RequestResource resource) login(Properties properties) Login to servers.voidshutdown()从类继承的方法 com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService
setNacosRestTemplate, setServerList
-
字段详细资料
-
SECURITY_LOGGER
private static final org.slf4j.Logger SECURITY_LOGGER -
tokenTtl
private long tokenTtlTTL of token in seconds. -
lastRefreshTime
private long lastRefreshTimeLast timestamp refresh security info from server. -
tokenRefreshWindow
private long tokenRefreshWindowtime window to refresh security info in seconds. -
loginIdentityContext
A context to take with when sending request to Nacos server. -
reLoginWindow
private final long reLoginWindowRe-login window in milliseconds.- 另请参阅:
-
-
构造器详细资料
-
NacosClientAuthServiceImpl
public NacosClientAuthServiceImpl()
-
-
方法详细资料
-
login
Login to servers.- 返回:
- true if login successfully
-
getLoginIdentityContext
-
shutdown
- 抛出:
NacosException
-
generateTokenRefreshWindow
public long generateTokenRefreshWindow(long tokenTtl) Randomly generate TokenRefreshWindow, Avoid a large number of logins causing pressure on the Nacos server.- 参数:
tokenTtl- TTL of token in seconds.- 返回:
- tokenRefreshWindow, numerical range [tokenTtl/15 ~ tokenTtl/10]
-