<a id="flat"></a>

# Flat

<a id="backend-class"></a>

## Backend class

For Django, add this class path to `AUTHENTICATION_BACKENDS`. For other
integrations, use the same class path in the framework-specific backend
setting.

| Backend name   | Class path                             |
|----------------|----------------------------------------|
| `flat`         | `social_core.backends.flat.FlatOAuth2` |

[Flat](https://flat.io) uses OAuth2. In order to enable the backend follow:

- On your project settings, you should add Flat on your
  `AUTHENTICATION_BACKENDS`:
  ```default
  AUTHENTICATION_BACKENDS = (
      ...
      'social_core.backends.flat.FlatOAuth2',
  )
  ```
- Register an application at [Flat Developer Portal](https://flat.io/developers)
- Fill in the **Client Id** and **Client Secret** values in your settings:
  ```default
  SOCIAL_AUTH_FLAT_KEY = ''
  SOCIAL_AUTH_FLAT_SECRET = ''
  ```
- Set the `Callback URL` to `http://<your hostname>/complete/flat/`
- Specify [scopes](https://flat.io/developers/api/reference/#section/Authentication) with:
  ```default
  SOCIAL_AUTH_FLAT_SCOPE = [...]
  ```
