-
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
[ISSUE #12719] refresh the client's access token #12765
Conversation
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #12765 +/- ##
=============================================
+ Coverage 72.14% 72.16% +0.02%
- Complexity 9782 9793 +11
=============================================
Files 1283 1283
Lines 41349 41379 +30
Branches 4366 4374 +8
=============================================
+ Hits 29833 29863 +30
+ Misses 9414 9411 -3
- Partials 2102 2105 +3
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
client/src/main/java/com/alibaba/nacos/client/auth/impl/NacosClientAuthServiceImpl.java
Outdated
Show resolved
Hide resolved
client/src/main/java/com/alibaba/nacos/client/naming/remote/gprc/NamingGrpcClientProxy.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
No implementation about step more interval to re-login which to invalid the real username and password error so that login API called so frequently.
-
It seems only naming module active, how about config?
关于账号或密码错误导致的re-login频繁确实是一个困难的问题,因为最理想的方式就是auth模块针对账号密码错误与token不合法的错误通过code区分开,但是这样需要重新制定auth spi对应的标准,改动范围不可控,关于第2点没太明白具体内容,能否详细说明一下? |
|
eadc546
to
dbe6d86
Compare
dbe6d86
to
29e9ae8
Compare
1.针对频繁调用login接口的问题,增加了时间窗口限制。 |
client/src/main/java/com/alibaba/nacos/client/security/SecurityProxy.java
Outdated
Show resolved
Hide resolved
|
|
What is the purpose of the change
issues#12719
Brief changelog
Modify the login logic in the NacosClientAuthServiceImpl code to record the refresh time of the token in the 'LoginIdentity Context'.
When the response code is determined to be 403 on the client side, set the parameter 'NextRefreshTime' in 'Login Identity Context' to 0.
After waiting for the timer task for 5 seconds, enter the login process and refresh the token.
Verifying this change
Modify the nacos.cre.auth.plugin.nacos.token.secreet.key parameter in the application and observe whether the client performs a re login operation