-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
临时关闭nacos鉴权时, 登录接口响应内容中tokenttl字段的值过大;恢复鉴权后客户端大面积403报错 #12060
Comments
welcome to fix it |
修复之前也考虑一下,现在未开启鉴权返回的token是固定的, token中会缺少ttl信息, 是不是连不开启鉴权的token也一起改一下,带上ttl信息。 |
针对该情况 目前我在方法com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager#createToken中,调整判断条件为:
|
DemonHugo
added a commit
to DemonHugo/nacos
that referenced
this issue
May 12, 2024
fix issue alibaba#12060 1. fix too large ttl when auth disabled 2. generate a valid token when key is valid even if auth disabled
5 tasks
DemonHugo
added a commit
to DemonHugo/nacos
that referenced
this issue
May 13, 2024
DemonHugo
added a commit
to DemonHugo/nacos
that referenced
this issue
May 13, 2024
DemonHugo
added a commit
to DemonHugo/nacos
that referenced
this issue
May 16, 2024
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
从2.0.3Nacos升级至最新版本后, 调用接口
POST:/nacos/v1/auth/login
的响应内容发生改变导致使用相同策略解决default.token.secret.key
漏洞时出现403报错.原处理方式:
Expected behavior
修改配置文件中
nacos.core.auth.enabled
的值为false后, 调用登录接口返回如下内容:Actually behavior
修改配置文件中
nacos.core.auth.enabled
的值为false后, 调用登录接口返回如下内容:其中核心问题在
tokenTtl
字段, 查看方法com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager#getTokenTtlInSeconds
中, 对于临时关闭鉴权的场景, 返回ttl逻辑为:此处ttl返回了一个非常大的值, 而客户端token刷新时间为9/10的ttl, 导致客户端几乎永远不会再调用登录接口重新获取token;
此处返回值修改为
tokenValidityInSeconds
的值是否更合理些?The text was updated successfully, but these errors were encountered: