Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Super simple OpenID and Google Federated Auth for Flask apps.

Project Description

This is a partial port of torando.auth to be used with Flask.

It is small, self contained and do not use any filesystem operations. Greate for internal apps.

Written by Alexander Saltanov, inspired by Kenneth Reitz.


Example usage for Google Federated Login.

Routes /login/ and /logout/ will be provided automagically.

Require an account from a given Google Apps domain for your Flask apps:

from flask import Flask, g
from flask_googleauth import GoogleFederated

# Setup Flask
app = Flask(__name__)
app.secret_key = "random secret key"

# Setup Google Federated Auth
auth = GoogleFederated("", app)

def secret():
    # Once user is authenticated, his name and email are accessible as
    # and
    return "You have rights to be here, %s (%s)" % (,

If you want to authenticate your users with general Google OpenID you should import and use GoogleAuth instead of GoogleFederated:

auth = GoogleAuth(app)

You can force all requests to be authenticated by setting force_auth_on_every_request on the auth object:

auth.force_auth_on_every_request = True


To install Flask-GoogleAuth:

pip install flask-googleauth


Be sure that your Google Apps domain is enabled to be an OpenID provider under “Advanced tools” → “Federated Login using OpenID”.

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-GoogleAuth-0.4.2.tar.gz (5.5 kB) Copy SHA256 Checksum SHA256 Source Feb 24, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting