Skip to content

zh-CN OAuth docs rework: OAuth2-only access guide + refresh-page de-dup#349

Merged
huacnlee merged 6 commits intomainfrom
feat/zhcn-oauth2-doc-rework
Mar 1, 2026
Merged

zh-CN OAuth docs rework: OAuth2-only access guide + refresh-page de-dup#349
huacnlee merged 6 commits intomainfrom
feat/zhcn-oauth2-doc-rework

Conversation

@xiaobo-gaga
Copy link
Collaborator

按要求新开 PR,专门修正 zh-CN OAuth 文档可读性与流程歧义。

变更内容

  1. docs/zh-CN/docs/api-reference/how-to-access-api.md
  • 改为 OAuth 2.0 主流程文档(OAuth2-only)
  • 移除旧 API Key / Signature 方案内容,避免新用户混淆
  • 按实际接入顺序重排:注册 client → 获取 code → 换 token → Bearer 调 API → refresh
  1. docs/zh-CN/docs/api-reference/refresh-token-api.md
  • 改为只讲 OAuth2 refresh token 刷新步骤
  • 明确与主流程文档分工,减少重复
  • /v1/token/refresh 调整为历史兼容说明,不作为新接入推荐

实际验证(Verification-first)

本次改动前后均做了真实接口验证:

  • Discovery 可用:
    • GET https://openapi.longportapp.cn/.well-known/oauth-authorization-server -> 200
  • Dynamic Client Registration 可用:
    • POST https://openapi.longportapp.cn/oauth2/register -> 200
    • 返回包含 client_id

@xiaobo-gaga
Copy link
Collaborator Author

@huacnlee 已按要求改为 TSLA.US 的实测示例,并写入真实返回节选。

更新:

  • 文件:docs/zh-CN/docs/api-reference/how-to-access-api.md
  • 第 4 步改为:
    • GET https://openapi.longportapp.cn/v1/quote/get_security_list?market=US&category=Overnight
  • 增加实际 response(节选,保留 TSLA.US 行)

本次验证链路(实际跑通):

  1. 你提供的授权 code 换 token 成功(200)
  2. 使用 Bearer 调用上述 API 成功(200)
  3. 返回 data.list 中确认包含 TSLA.US

commit: 28a11cc

@xiaobo-gaga
Copy link
Collaborator Author

补充更正:上一条评论里的 commit 号写错了,正确是 \。

@xiaobo-gaga
Copy link
Collaborator Author

补充更正:上一条评论里的 commit 号写错了,正确是 a13fabe

@xiaobo-gaga
Copy link
Collaborator Author

@huacnlee 已补充 #349 的英文内容,和 zh-CN 口径对齐:\n\n- \n - 改为 OAuth2 主流程文档(默认方式)\n - 明确 api-key 签名仅作备选兼容\n - 增加 TSLA.US 实测示例与 response 节选\n- \n - 改为仅讲 OAuth2 refresh,和主流程文档消歧\n - 旧 仅保留兼容说明\n\ncommit: 18a4d47

@xiaobo-gaga
Copy link
Collaborator Author

补充更正:上一条评论里因 shell 转义出现杂讯。实际已完成英文补充,正确 commit 是 9a83865

@xiaobo-gaga
Copy link
Collaborator Author

@huacnlee 已补齐 #349 的 zh-HK 内容:\n\n- \n - 重写为 OAuth2 主流程\n - 明确 API-key 仅备选兼容,不是默认\n - 补 TSLA.US 示例与真实 response 节选\n- \n - 改为仅讲 OAuth2 refresh\n - 与主流程文档消歧\n - 旧 仅保留兼容说明\n\ncommit: 980e857

@xiaobo-gaga
Copy link
Collaborator Author

补充更正:上一条评论里的 commit 号写错了,正确是 d644a5b

@huacnlee
Copy link
Member

huacnlee commented Mar 1, 2026

@xiaobo-gaga 用 .com

@xiaobo-gaga
Copy link
Collaborator Author

@huacnlee 已改为 .com(en / zh-CN / zh-HK 同步)。\n\ncommit: 0a7bb23

@xiaobo-gaga
Copy link
Collaborator Author

补充更正:上一条评论里的 commit 号写错,正确是 5709de2

@huacnlee huacnlee merged commit f297ee9 into main Mar 1, 2026
2 checks passed
@huacnlee huacnlee deleted the feat/zhcn-oauth2-doc-rework branch March 1, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants