-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
User Logs Out Within Access Token Expiration Time, Old Access Token Still Used in Request Header Causes Background Interface to Remain Accessible #10962
Comments
Hey @113223! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let me know how I can assist you! The issue you're experiencing seems to be related to the access token not being invalidated immediately upon logout. In the Dify codebase, the logout functionality involves revoking the access token by deleting it from the Redis store using the Here are a few things you might want to check or try:
If these steps do not resolve the issue, there might be a need to further investigate the specific implementation details or any potential bugs in the codebase related to token management. |
This is how JWT works: it will expire quickly after you log out. More importantly, make sure to keep your token safe and avoid any leaks. |
in fact , it will not expire quickly after you log out. when i use AccountService.logout(account=account) function,clear the refresh_token, but access_token is not expire quickly ,the old access_token is still used in the request header, the background interface can still access. |
This is as expected. Please confirm that you are familiar with the JWT authorization. If you have stricter security requirements, you can shorten the validity period of the JWT by adjusting the ACCESS_TOKEN_EXPIRE_MINUTES. However, it will still be usable until it expires. |
get it ,thank you |
Self Checks
Dify version
0.11
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
When the user exits within the expiration time of access_token, but the old access_token is still used in the request header, the background interface can still access the problem
✔️ Expected Behavior
When the user exits within the expiration time of access_token, but the old access_token is still used in the request header, the background interface can not access
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: