Package oauth2client :: Module appengine
[hide private]
[frames] | no frames]

Module appengine

source code

Utilities for Google App Engine

Utilities for making it easier to use OAuth 2.0 on Google App Engine.


Author: jcgregorio@google.com (Joe Gregorio)

Classes [hide private]
  InvalidClientSecretsError
The client_secrets.json file is malformed or missing required fields.
  InvalidXsrfTokenError
The XSRF token is invalid or expired.
  SiteXsrfSecretKey
Storage for the sites XSRF secret key.
  AppAssertionCredentials
Credentials object for App Engine Assertion Grants
  FlowProperty
App Engine datastore Property for Flow.
  CredentialsProperty
App Engine datastore Property for Credentials.
  StorageByKeyName
Store and retrieve a single credential to and from the App Engine datastore.
  CredentialsModel
Storage for OAuth 2.0 Credentials
  OAuth2Decorator
Utility for making OAuth 2.0 easier.
  OAuth2DecoratorFromClientSecrets
An OAuth2Decorator that builds from a clientsecrets file.
Functions [hide private]
 
_safe_html(s)
Escape text to make it safe to display.
source code
 
_generate_new_xsrf_secret_key()
Returns a random XSRF secret key.
source code
 
xsrf_secret_key()
Return the secret key for use for XSRF protection.
source code
 
_build_state_value(request_handler, user)
Composes the value for the 'state' parameter.
source code
 
_parse_state_value(state, user)
Parse the value of the 'state' parameter.
source code
Variables [hide private]
  logger = logging.getLogger(__name__)
  OAUTH2CLIENT_NAMESPACE = 'oauth2client#ns'
  XSRF_MEMCACHE_ID = 'xsrf_secret_key'
  __package__ = 'oauth2client'
Function Details [hide private]

_safe_html(s)

source code 
Escape text to make it safe to display.

Args:
  s: string, The text to escape.

Returns:
  The escaped text as a string.

xsrf_secret_key()

source code 
Return the secret key for use for XSRF protection.

If the Site entity does not have a secret key, this method will also create
one and persist it.

Returns:
  The secret key.

_build_state_value(request_handler, user)

source code 
Composes the value for the 'state' parameter.

Packs the current request URI and an XSRF token into an opaque string that
can be passed to the authentication server via the 'state' parameter.

Args:
  request_handler: webapp.RequestHandler, The request.
  user: google.appengine.api.users.User, The current user.

Returns:
  The state value as a string.

_parse_state_value(state, user)

source code 
Parse the value of the 'state' parameter.

Parses the value and validates the XSRF token in the state parameter.

Args:
  state: string, The value of the state parameter.
  user: google.appengine.api.users.User, The current user.

Raises:
  InvalidXsrfTokenError: if the XSRF token is invalid.

Returns:
  The redirect URI.