client don't judge token content invalid. (#11496)
This commit is contained in:
parent
a3420b733b
commit
58803687c8
@ -18,11 +18,11 @@ package com.alibaba.nacos.client.auth.impl;
|
||||
|
||||
import com.alibaba.nacos.api.PropertyKeyConst;
|
||||
import com.alibaba.nacos.api.exception.NacosException;
|
||||
import com.alibaba.nacos.plugin.auth.api.LoginIdentityContext;
|
||||
import com.alibaba.nacos.client.auth.impl.process.HttpLoginProcessor;
|
||||
import com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService;
|
||||
import com.alibaba.nacos.plugin.auth.api.RequestResource;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.alibaba.nacos.plugin.auth.api.LoginIdentityContext;
|
||||
import com.alibaba.nacos.plugin.auth.api.RequestResource;
|
||||
import com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -84,7 +84,7 @@ public class NacosClientAuthServiceImpl extends AbstractClientAuthService {
|
||||
properties.setProperty(NacosAuthLoginConstant.SERVER, server);
|
||||
LoginIdentityContext identityContext = httpLoginProcessor.getResponse(properties);
|
||||
if (identityContext != null) {
|
||||
if (StringUtils.isNotBlank(identityContext.getParameter(NacosAuthLoginConstant.ACCESSTOKEN))) {
|
||||
if (identityContext.getAllKey().contains(NacosAuthLoginConstant.ACCESSTOKEN)) {
|
||||
tokenTtl = Long.parseLong(identityContext.getParameter(NacosAuthLoginConstant.TOKENTTL));
|
||||
tokenRefreshWindow = tokenTtl / 10;
|
||||
lastRefreshTime = System.currentTimeMillis();
|
||||
|
Loading…
Reference in New Issue
Block a user