百度智能小程序错误码解读
类别:推广优化   时间:10-13

百度OAuth2.0在接受验证授权请求时,授权服务器会按照OAuth2.0协议对本次请求参数、请求头部进行检验,若请求不合法或验证未通过,授权服务器会返回相应的错误信息。 

错误码返回信息简介

错误码返回方式分两种:

1、在浏览器访问请求授权Endpoint"/d/file/2019/10/13/44954

2、在应用的服务端访问数据接口,如: 请求Access Token Endpoint"/d/file/2019/10/13/45054

error:错误码; 
error_description:错误描述信息,用来帮助理解和解决发生的错误。

例如:

HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store

{
   "error": "invalid_grant",
   "error_description": "Invalid authorization code: ANXxSNjwQDugOnqeikRMu2bKaXCdlLxn"

invalid_request    

invalid refresh token    

请求缺少某个必需参数,包含一个不支持的参数或参数值,或者格式不正确。    

invalid_client    

unknown client id    

client_id”、“client_secret”参数无效。    

invalid_grant    

The provided authorization grant is revoked    

提供的Access Grant是无效的、过期的或已撤销的,例如,Authorization Code无效(一个授权码只能使用一次)、Refresh Token无效、redirect_uri与获取Authorization Code时提供的不一致、Devie Code无效(一个设备授权码只能使用一次)等。    

unauthorized_client    

The client is not authorized to use this authorization grant type    

应用没有被授权,无法使用所指定的grant_type。    

unsupported_grant_type    

The authorization grant type is not supported    

“grant_type”百度OAuth2.0服务不支持该参数。    

invalid_scope    

The requested scope is exceeds the scope granted by the resource owner    

请求的“scope”参数是无效的、未知的、格式不正确的、或所请求的权限范围超过了数据拥有者所授予的权限范围。    

expired_token    

refresh token has been used    

提供的Refresh Token已过期    

redirect_uri_mismatch    

Invalid redirect uri    

“redirect_uri”所在的根域与开发者注册应用时所填写的根域名不匹配。    

unsupported_response_type    

The response type is not supported    

“response_type”参数值不为百度OAuth2.0服务所支持,或者应用已经主动禁用了对应的授权模式    

slow_down    

The device is polling too frequently    

Device Flow中,设备通过Device Code换取Access Token的接口过于频繁,两次尝试的间隔应大于5秒。    

authorization_pending    

User has not yet completed the authorization    

Device Flow中,用户还没有对Device Code完成授权操作。    

authorization_declined    

User has declined the authorization   

Device Flow中,用户拒绝了对Device Code的授权操作。    

invalid_referer    

Invalid Referer    

Implicit Grant模式中,浏览器请求的Referer与根域名绑定不匹配    

智慧半岛,是一家专注于青岛网站建设青岛网站开发的青岛网络公司,Copyright ©2007-2019 Ebandao.Cn 版权所有 All Rights Reserved.(建议在1366x768以上的浏览器中访问)鲁ICP备08014496号

13153297890