<a id="mixcloud-oauth2"></a>

# Mixcloud OAuth2

<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                                     |
|----------------|------------------------------------------------|
| `mixcloud`     | `social_core.backends.mixcloud.MixcloudOAuth2` |

The [Mixcloud API](http://www.mixcloud.com/developers/documentation) offers support for authorization. To enable this backend:

- Register a new application at [Mixcloud Developers](http://www.mixcloud.com/developers)
- Add Mixcloud backend to `AUTHENTICATION_BACKENDS` in settings:
  ```default
  SOCIAL_AUTH_AUTHENTICATION_BACKENDS = (
      ...
      'social_core.backends.mixcloud.MixcloudOAuth2',
  )
  ```
- Fill `Client Id` and `Client Secret` values in the settings:
  ```default
  SOCIAL_AUTH_MIXCLOUD_KEY = ''
  SOCIAL_AUTH_MIXCLOUD_SECRET = ''
  ```
- Similar to the other OAuth backends you can define:
  ```default
  SOCIAL_AUTH_MIXCLOUD_EXTRA_DATA = [('username', 'username'),
                                     ('name', 'name'),
                                     ('pictures', 'pictures'),
                                     ('url', 'url')]
  ```

  as a list of tuples `(response name, alias)` to store user profile data on
  the `UserSocialAuth.extra_data`.

Mixcloud does not expose a documented stable account identifier. The backend is
association-only: an authenticated local user must initiate and complete the
connection. Mixcloud cannot create a local user or authenticate a logged-out
user.
