Public Member Functions | |
def | authorize_redirect |
def | get_authenticated_user |
Private Member Functions | |
def | _oauth_consumer_token |
def | _oauth_get_user |
Static Private Attributes | |
string | _OAUTH_ACCESS_TOKEN_URL = "https://www.google.com/accounts/OAuthGetAccessToken" |
string | _OPENID_ENDPOINT = "https://www.google.com/accounts/o8/ud" |
Google Open ID / OAuth authentication. No application registration is necessary to use Google for authentication or to access Google resources on behalf of a user. To authenticate with Google, redirect with authenticate_redirect(). On return, parse the response with get_authenticated_user(). We send a dict containing the values for the user, including 'email', 'name', and 'locale'. Example usage:: class GoogleHandler(tornado.web.RequestHandler, tornado.auth.GoogleMixin): @tornado.web.asynchronous def get(self): if self.get_argument("openid.mode", None): self.get_authenticated_user(self.async_callback(self._on_auth)) return self.authenticate_redirect() def _on_auth(self, user): if not user: raise tornado.web.HTTPError(500, "Google auth failed") # Save the user with, e.g., set_secure_cookie()
def tornado.auth.GoogleMixin._oauth_consumer_token | ( | self | ) | [private] |
def tornado.auth.GoogleMixin._oauth_get_user | ( | self, | |
access_token, | |||
callback | |||
) | [private] |
Reimplemented from tornado.auth.OAuthMixin.
def tornado.auth.GoogleMixin.authorize_redirect | ( | self, | |
oauth_scope, | |||
callback_uri = None , |
|||
ax_attrs = ["name" , |
|||
email, | |||
language, | |||
username | |||
) |
Authenticates and authorizes for the given Google resource. Some of the available resources are: * Gmail Contacts - http://www.google.com/m8/feeds/ * Calendar - http://www.google.com/calendar/feeds/ * Finance - http://finance.google.com/finance/feeds/ You can authorize multiple resources by separating the resource URLs with a space.
def tornado.auth.GoogleMixin.get_authenticated_user | ( | self, | |
callback | |||
) |
string tornado::auth.GoogleMixin::_OAUTH_ACCESS_TOKEN_URL = "https://www.google.com/accounts/OAuthGetAccessToken" [static, private] |
string tornado::auth.GoogleMixin::_OPENID_ENDPOINT = "https://www.google.com/accounts/o8/ud" [static, private] |