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 |