-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(123_open): fix token refresh #1121
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
Conversation
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.
Pull Request Overview
This PR fixes the token refresh mechanism in the 123_open driver by ensuring client_secret is included in OAuth2 endpoint requests as required by the API documentation.
- Restructures the conditional logic to require both
ClientIDandClientSecretbefore attempting token operations - Adds missing
client_secretparameter to the refresh token request - Reorders the token acquisition flow to prioritize refresh token usage when available
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
xrgzs
left a comment
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.
OpenList 内,只需要提供两种就可以:
- Client ID + Client Secret:开发者接入
- Client ID + Refresh Token:第三方挂载应用接入(使用回调)
对于下面这两种,一般不会出现
- Client ID + Client Secret + Refresh Token
- Client ID + Client Secret + Code
因为第三方挂载应用接入的 Client Secret 通常不会公开,只会放到 OpenList-APIPages 上,而且一般申请不到,OpenListTeam不满足资质认证,不会主动对接
另外,第 2 种的 Refresh Token 也能一直刷新
因此,保留原始逻辑即可
|
@xrgzs 我理解,这个 pr 主要解决的问题是原来只要填写了
这个按照目前 123 的逻辑确实就是足够了
这个我认为无论是按照 123 的文档 还是 oauth 的文档 都有提到传递 |
xrgzs
left a comment
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.
LGTM
client_secretis required foroauth2endpointlet
refresh_tokendetermine the auth flowdocs: https://123yunpan.yuque.com/org-wiki-123yunpan-muaork/cr6ced/gammzlhe6k4qtwd9