tipfy.ext.auth.google ¶
This extension provides a mixin that implements Google OpenId / OAuth authentication.
Try our Google auth demo (source here).
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:
from tipfy import RequestHandler, abort
from tipfy.ext.auth.google import GoogleMixin
class GoogleHandler(RequestHandler, GoogleMixin):
def get(self):
if self.request.args.get('openid.mode', None):
return self.get_authenticated_user(self._on_auth)
return self.authenticate_redirect()
def _on_auth(self, user):
if not user:
abort(403)
# Set the user in the session.
# ...
Extension Reference¶
- Name: tipfy.ext.auth.google
- Author: Rodrigo Moraes, ported from tornado.auth
- License: Apache Software License
- Tags: authentication, users
- URL: http://www.tipfy.org/wiki/extensions/auth/google/
- PyPi page: http://pypi.python.org/pypi/tipfy.ext.auth.google/
- Source code: http://code.google.com/p/tipfy-ext-auth-google/
- Issue tracker: http://code.google.com/p/tipfy-ext-auth-google/issues/list
- Version: latest
- Edited by moraes on 7/21/10 5:42 PM
- Save on Delicious | Submit to Reddit
- History
- Edit
