'invalid_request':'The request is otherwise malformed',
'unauthorized_client':'The client is not authorized to request an authorization code using this method',
'access_denied':'The resource owner or authorization server denied the request',
'unsupported_response_type':'The authorization server does not support obtaining an authorization code using this method',
'invalid_scope':'The requested scope is invalid, unknown, or malformed',
'server_error':'The authorization server encountered an error',
'temporarily_unavailable':'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server',
'invalid_request':'The request is otherwise malformed',
'invalid_client':'Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)',
'invalid_grant':'The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client',
'unauthorized_client':'The authenticated client is not authorized to use this authorization grant type',
'unsupported_grant_type':'The authorization grant type is not supported by the authorization server',
'invalid_scope':'The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner',
}
def__init__(self,error):
self.error=error
self.description=self._errors.get(error)
defcreate_dict(self):
dic={
'error':self.error,
'error_description':self.description,
}
returndic
classUserInfoError(Exception):
_errors={
# Oauth2 errors.
# https://tools.ietf.org/html/rfc6750#section-3.1
'invalid_request':('The request is otherwise malformed',400),
'invalid_token':('The access token provided is expired, revoked, malformed, or invalid for other reasons',401),
'insufficient_scope':('The request requires higher privileges than provided by the access token',403),