百度智能小程序错误码解读

 杭州seo优化   2022-06-24 13:42   73 views 人阅读  0 条评论
摘要:

百度OAuth2.0在接受验证授权请求时,授权服务器会按照OAuth2.0协议对本次请求参数、请求头部进行检验,若请求不合法或验证未通过,授权服务器会返回相应的错误信息。错误码返回信息简介错误码返回方式分两种:1、在浏览器访问请求授权E

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

 

错误码返回信息简介

错误码返回方式分两种:

1、在浏览器访问请求授权Endpoint"https://openapi.baidu.com/oauth/2.0/authorize"时返回,直接在浏览器页面上显示错误信息。

2、在应用的服务端访问数据接口,如: 请求Access Token Endpoint"https://openapi.baidu.com/oauth/2.0/token"时返回,返回方式是返回一段JSON文本,包含以下字段:

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与根域名绑定不匹配

 

阅读本文的人还可以阅读:

百度智能小程序入口有哪些?哪里可以进入百度智能小程序?

百度智能小程序开源联盟是什么

百度智能小程序的流量为什么那么高,小程序如何引流?

怎样做好百度智能小程序体验设计(1)

写在结尾:以上就是百度智能小程序错误码解读的详细内容,更多请关注【杭州SEO博客】其它相关文章!
本文地址:http://seo.huashi123.cn/13941.html
版权声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系我们。

 相关文章  关键词:

 发表评论


表情