Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Authenticate Django Users against Google Apps. Check simul14's fork, it's more active
branch: master

Merge pull request #1 from willcritchlow/master

Change to allow exclusion of sub-folders from auth
latest commit ca5dc521d2
Maximillian Dornseif mdornseif authored
Failed to load latest commit information.
googleappsauth allow sub-folders of protected areas to be accessible without authent…
.gitignore moved to more modern python
CHANGES slight API cleanup, removed hardcoded domain graceful handling of broken session engine
Makefile first stab at seperating googleauth from hudoratools
README.rst allow sub-folders of protected areas to be accessible without authent…
requirements.txt Version hoch


Authentication agains Google Apps Domains for Django

googleappsauth allows you to authenticate your Django users against an Google Apps domain. This means you basically get a single sign-on solution, provided that all users of your django application also have Accounts in Google Apps for your Domain.


To use googleappsauth, configuration in should look like this:

# domain where your application is running

If you want to choose from a list of Google apps domains on a login-by-login basis you can configure an array of apps domains:

GOOGLE_APPS_DOMAIN = ['', '', '']

You also can tell googleappsauth where to go after successfull authentication, in case the redirect_url had not been set. LOGIN_REDIRECT_URL defaults to /.


To activate googleappsauth, set the appropriate Authentication backend and include a callback view.
AUTHENTICATION_BACKENDS = ('googleappsauth.backends.GoogleAuthBackend',)
(r'^callback_googleappsauth/', 'googleappsauth.views.callback'),

Using a special middleware which is included in the package, you can block access to a compete site.


In addition you can set AUTH_PROTECTED_AREAS to authenticate only access to certain parts of a site, e.g.


If you wish, you can add AUTH_EXCLUDED_AREAS to remove authentication from sub-folders of your protected areas, e.g.

AUTH_EXCLUDED_AREAS = ['/admin/public']


Get it at the Python Cheeseshop or at GitHub.

See also


You might need to enable the OAuth+OpenID support in your Google Apps domain at<your-domain>/SetupIdp

You might need to register at Might look like this:

If google claims "invalid page" check GOOGLE_OPENID_REALM.

Something went wrong with that request. Please try again.