跳转到文档
打开控制台
本页内容

GET /oauth/authorize

OAuth 使用 S256 PKCE、精确匹配的重定向 URI,以及独立的 REST 或 MCP 资源。授权同意在 Tong 中完成。刷新令牌每次使用后都会轮换。

请求示例#

curl 'https://platform.tongai.io/oauth/authorize?client_id=https%3A%2F%2Fyour-app.example%2Foauth%2Fclient.json&redirect_uri=https%3A%2F%2Fyour-app.example%2Foauth%2Fcallback&resource=https%3A%2F%2Fplatform.tongai.io%2Fmcp&scope=catalog%3Aread+operations%3Aread&code_challenge=BASE64URL_SHA256_OF_VERIFIER&code_challenge_method=S256&response_type=code&state=RANDOM_SESSION_STATE'
配置
curl --version

身份验证#

none

参数#

client_idstring必填
redirect_uristring必填
resourcestring必填
scopestring必填
code_challengestring必填
code_challenge_methodstring必填
response_typestring必填
statestring可选

请求正文#

此端点没有请求正文。

响应架构#

在用户浏览器中打开授权 URL。Tong 显示授权确认,然后将授权码发送至已注册的重定向 URI。

HTTP
HTTP/1.1 302 FoundLocation: https://tongai.io/developers/authorize?id=e8aa0a87-6cd9-42eb-975a-b72bf43218c8

响应没有正文。

错误与限制#

JSON
{  "error": "invalid_request"}