实例级授权服务器 Token 端点
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
POST /v2/{instanceId}/authorizationServer/{authorizationServerId}/oauth2/token HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| instanceId |
string |
是 |
实例 ID。 |
idaas_ue2jvisn35ea5lmthk267xxxxx |
| authorizationServerId |
string |
是 |
授权服务器 ID。 |
iauths_system |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| grant_type |
string |
是 |
授权类型。 |
authorization_code |
| client_id |
string |
是 |
客户端 ID。 |
app_mkv7rgt4d7i4u7zqtzev2mxxxx |
| code |
string |
否 |
授权 code 码,传入场景: grant_type=authorization_code 授权码模式时,必填参数。 |
CO541xY59EsKniV2wvWDXZ4jiKxxxxx |
| username |
string |
否 |
用户名。 |
userxxxxx |
| password |
string |
否 |
用户密码。 |
testxxxxx |
| device_code |
string |
否 |
设备 code 码,传入场景: grant_type=urn:ietf:params:oauth:grant-type:device_code 即设备流模式时,必填参数。 |
DCxxxxxx |
| redirect_uri |
string |
否 |
重定向 URI,传入场景: grant_type=authorization_code 授权码模式时,必须参数,与获取授权码请求中的重定向 URI 必须是一致的。 |
https://example.com/xxxxx |
| refresh_token |
string |
否 |
刷新凭证。 |
RTxxxxx |
| scope |
string |
否 |
scope 范围。 |
openid |
| code_verifier |
string |
否 |
验证 code。 |
xxxxx |
| client_assertion |
string |
否 |
客户端断言。 |
eyJraWQiOiJLRVlLZ0Iyxxxxx |
| client_assertion_type |
string |
否 |
客户端断言的类型。 |
urn:ietf:params:oauth:client-assertion-type:jwt-bearer |
| application_federated_credential_name |
string |
否 |
应用联邦凭证名称。 |
testxxxxx |
| client_x509 |
string |
否 |
终端证书。 |
testxxxxx |
| client_x509_chain |
string |
否 |
中间证书列表。 |
testxxxxx |
| client_secret |
string |
否 |
客户端密钥。 |
CSEHDcHcrUKHw1CuxkJEHPveWRxxxxx |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
token 信息 |
||
| token_type |
string |
凭证类型。 |
Bearer |
| access_token |
string |
访问凭证。 |
eyJraWQiOiJLRVlLZ0Iyxxxxx |
| refresh_token |
string |
刷新凭证。 |
ATxxxxx |
| expires_in |
integer |
访问凭证的有效时长,单位为秒。 |
1200 |
| expires_at |
integer |
访问凭证的失效时间,格式为 Unix 时间戳,单位为秒。 |
1653288641 |
| id_token |
string |
身份凭证。 |
eyJraWQiOiJLRVlLZ0Iyxxxxx |
| scope |
string |
scope 范围。 |
openid |
示例
正常返回示例
JSON格式
{
"token_type": "Bearer",
"access_token": "eyJraWQiOiJLRVlLZ0Iyxxxxx\n",
"refresh_token": "ATxxxxx",
"expires_in": 1200,
"expires_at": 1653288641,
"id_token": "eyJraWQiOiJLRVlLZ0Iyxxxxx\n",
"scope": "openid"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。