google.appengine.api.oauth package

Module contents

OAuth API module.

exception google.appengine.api.oauth.Error[source]

Bases: exceptions.Exception

Base error class for this module.

exception google.appengine.api.oauth.OAuthRequestError[source]

Bases: google.appengine.api.oauth.oauth_api.Error

Base error type for invalid OAuth requests.

exception google.appengine.api.oauth.NotAllowedError[source]

Bases: google.appengine.api.oauth.oauth_api.OAuthRequestError

Raised if the requested URL does not permit OAuth authentication.

exception google.appengine.api.oauth.InvalidOAuthParametersError[source]

Bases: google.appengine.api.oauth.oauth_api.OAuthRequestError

Raised if the request was a malformed OAuth request.

For example, the request may have omitted a required parameter, contained an invalid signature, or was made by an unknown consumer.

exception google.appengine.api.oauth.InvalidOAuthTokenError[source]

Bases: google.appengine.api.oauth.oauth_api.OAuthRequestError

Raised if the request contained an invalid token.

For example, the token may have been revoked by the user.

exception google.appengine.api.oauth.OAuthServiceFailureError[source]

Bases: google.appengine.api.oauth.oauth_api.Error

Raised if there was a problem communicating with the OAuth service.

google.appengine.api.oauth.get_current_user(_scope=None)[source]

Returns the User on whose behalf the request was made.

Args:
_scope: The custom OAuth scope or an iterable of scopes at least one of
which is accepted.
Returns:
User
Raises:
OAuthRequestError: The request was not a valid OAuth request. OAuthServiceFailureError: An unknown error occurred.
google.appengine.api.oauth.is_current_user_admin(_scope=None)[source]

Returns true if the User on whose behalf the request was made is an admin.

Args:
_scope: The custom OAuth scope or an iterable of scopes at least one of
which is accepted.
Returns:
boolean
Raises:
OAuthRequestError: The request was not a valid OAuth request. OAuthServiceFailureError: An unknown error occurred.
google.appengine.api.oauth.get_oauth_consumer_key()[source]

Returns the value of the ‘oauth_consumer_key’ parameter from the request.

Returns:
string: The value of the ‘oauth_consumer_key’ parameter from the request,
an identifier for the consumer that signed the request.
Raises:
OAuthRequestError: The request was not a valid OAuth request. OAuthServiceFailureError: An unknown error occurred.
google.appengine.api.oauth.get_client_id(_scope)[source]

Returns the value of OAuth2 Client ID from an OAuth2 request.

Args:
_scope: The custom OAuth scope or an iterable of scopes at least one of
which is accepted.
Returns:
string: The value of Client ID.
Raises:
OAuthRequestError: The request was not a valid OAuth2 request. OAuthServiceFailureError: An unknow error occurred.
google.appengine.api.oauth.get_authorized_scopes(scope)[source]

Returns authorized scopes from input scopes.

Args:
scope: The custom OAuth scope or an iterable of scopes at least one of
which is accepted.
Returns:
list: A list of authorized OAuth2 scopes
Raises:
OAuthRequestError: The request was not a valid OAuth2 request. OAuthServiceFailureError: An unknow error occurred