POST /oauth/register
OAuth 使用 S256 PKCE、精确匹配的重定向 URI,以及独立的 REST 或 MCP 资源。授权同意在 Tong 中完成。刷新令牌每次使用后都会轮换。
请求示例#
curl -X POST 'https://platform.tongai.io/oauth/register' \ -H "Content-Type: application/json" \ -d '{ "client_name": "example", "redirect_uris": [ "https://your-app.example/events" ], "scope": "example"}'配置
curl --version身份验证#
none参数#
无需参数。
请求正文#
application/jsonclient_namestring必填最小长度:1 个字符。
最大长度:120 个字符。
redirect_urisstring[]必填最少项目数:1。
最多项目数:10。
scopestring必填最大长度:3000 个字符。
token_endpoint_auth_methodstring可选允许的值
"none"默认值:"none"。
grant_typesstring[]可选默认值:["authorization_code","refresh_token"]。
response_typesstring[]可选默认值:["code"]。
响应架构#
{ "client_id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "client_name": "Your application", "redirect_uris": [ "https://your-app.example/oauth/callback" ], "scope": "catalog:read operations:read", "token_endpoint_auth_method": "none", "grant_types": [ "authorization_code", "refresh_token" ], "response_types": [ "code" ]}错误与限制#
{ "error": "invalid_client_metadata"}