Log in

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


Powered by Moe. Yeah, the name is Moe. Powered by Google App Engine