tildaslash/RatticWeb — pull request #308 by ipernet (2014-10-15 13:41:59+00:00)
Title: Google oauth2 auth for Rattic

Feature
=

Add support for using Rattic with a Google oauth2 authentication.

Useful if your company uses Google Apps for Work and users can login using their Google App company accounts.

Based on [Django Social Auth](http://django-social-auth.readthedocs.org/en/latest/intro.html).

Usage
=

1. Create a new Google API project for your Rattic setup at https://console.developers.google.com/
2. Enable the "Google+ API" in *APIS & auth > APIs*
3. Specify an email address and a product name in "*Consent screen*"
4. Create a new Client ID in "*Credentials*" and use \*/complete/google-oauth2/* as "*REDIRECT URI*"
6. Edit your Rattic *local.cfg* and add:

```
[goauth2]
client_id = GENERATED_CLIENT_ID
client_secret = GENERATED_CLIENT_SECRET
domain = DOMAIN_OAUTH_USER_EMAIL_MUST_BELONG
https_only = false
```

If you use a https setup with Rattic behind a reverse proxy such as NGINX, use `https_only = true` and ensure you have correctly added the following proxy headers in your nginx Rattic conf:

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;