跳到主要内容
在线体验
微信咨询
获取方案

吊销指定令牌

吊销指定的access_token或refresh_token。

请求说明​

请求方式:POST

请求地址:https://{your_domain}/api/v1/authorize/{app_code}/oauth2/revoke

请求头​

参数名中文名称必须示例值描述
Authorization认证信息是Basic MTk4MzhkOTc0ZTM=使用client_id和client_secret进行basic64认证,格式为: base64(client_id:client_secret)。

请求示例​

POST https://{your_domain}/api/v1/authorize/{app_code}/oauth2/revoke
Authorization: Bearer eyJraWQiOiIxMTI5MDE5ifQ...
?token=LGNP5bRKmuiIhmJPDkuGnx...&token_type_hint=refresh_token

请求参数​

参数名中文名称必须示例值描述
token令牌是LGNP5bRKmuiIhmJPDkuGnx...令牌,根据token_type_hint类型传递。
token_type_hint令牌类型是refresh_token令牌类型,可选值:access_token、refresh_token。

响应参数​

无

响应示例​

成功​

HTTP Status: 200

token 未传递​

{
"error_description": "OAuth 2.0 Token Revocation Parameter: token",
"error": "invalid_request",
"error_uri": "https://topiam.cn/docs/application/oidc/faq/#%E9%94%99%E8%AF%AF%E7%A0%81"
}

客户端未认证​

{
"error_description": "Full authentication is required to access this resource",
"error": "access_denied",
"error_uri": "https://topiam.cn/docs/application/oidc/faq/#错误码"
}

client_id 或 client_secret 错误​

{
"error_description": "Client authentication failed. Either the client or the client credentials are invalid.",
"error": "invalid_client",
"error_uri": "https://topiam.cn/docs/application/oidc/faq/#错误码"
}