Two ways for Weibo to Return Error Codes

Source: Internet
Author: User
Tags unsupported

 

Oauth2.0 error code

In the implementation of Sina Weibo oauth2.0, the authorization server will check the request header and Request Parameters in accordance with the oauth2.0 protocol when receiving the authentication request. If the request is illegal or the verification fails, the authorization server returns an error message, which includes the following parameters:

  • Error: Error Code
  • Error_code: Error internal number
  • Error_description: Error description
  • Error_url: a readable webpage URI with error information, used to provide end users with additional error-related information.

There are two methods to return error messages:

1. When an error occurs when requesting to authorize the endpoint: https://api.weibo.com/2/oauth2/authorize, the return method is: Jump to redirect_uri and include the error description in the query parameter of the URI.

2. An error occurred when requesting access token endpoing: https://api.weibo.com/oauth2/access_token. Return Method: Return JSON text.

For example:

{

  • "Error": "unsupported_response_type ",
  • "Error_code": 21329
  • "Error_description": "unsupported responsetype ."

}

The following table lists the error codes in oauth2.0 error responses:

Error) Error Code (error_code) Error description (error_description)
Redirect_uri_mismatch 21322 The redirection address does not match.
Invalid_request 21323 The request is invalid.
Invalid_client 21324 The client_id or client_secret parameter is invalid.
Invalid_grant 21325 The provided access grant is invalid, expired, or revoked
Unauthorized_client 21326 The client has no permission.
Expired_token 21327 Token expired
Unsupported_grant_type 21328 Unsupported granttype
Unsupported_response_type 21329 Unsupported responsetype
Access_denied 21330 The user or the authorized server refuses to grant data access permissions.
Temporarily_unavailable 21331 Service temporarily unavailable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.