令牌端点
POST /oauth/token
用授权码换取 Access Token,或用 Refresh Token 刷新。
响应 Content-Type: application/json; charset=utf-8
频率限制
- 30 次/分钟(基于请求方 IP,非服务器全局限制)
- 超限返回 HTTP 429,响应头包含
Retry-After
Authorization Code Grant
用授权码换取 Token。
请求
POST https://id.caellab.com/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=AUTHORIZATION_CODE
&redirect_uri=YOUR_CALLBACK_URL
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&code_verifier=YOUR_CODE_VERIFIER
公共客户端(应用设置里选了「公共客户端」)不需要 client_secret,只传 client_id 即可,安全性由 PKCE 承担。
也支持 HTTP Basic Auth 传递凭证(仅机密客户端):
POST https://id.caellab.com/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic BASE64(client_id:client_secret)
grant_type=authorization_code
&code=AUTHORIZATION_CODE
&redirect_uri=YOUR_CALLBACK_URL