A django-allauth provider for the Orfium.com music platform.
pip install orfium-oauth-provider==0.1.9
orfium-oauth-provider as requirements to your project and install them.
Add the following apps to your INSTALLED_APPS
In case you use DRF, add 'rest_framework.authtoken',
Make sure the following context processor is included in the
'allauth.account.auth_backends.AuthenticationBackend' to the
Specify the social account adapter (Allows connecting the orfium user account to your apps local users based on their usernames):
SOCIALACCOUNT_ADAPTER = 'orfium_oauth_provider.adapters.ConnectExistingUsersSocialAccountAdapter'
SITE_ID = 1 in your settings
/accounts/orfium_oauth2/login/?process=login as the login link to automatically redirect users to Orfium,
or optionally add the following to your
MIDDLEWARE setting if you want all pages to be protected:
If you use the middleware, you can specify which paths should be ignored by using the
AUTH_REQUIRED_IGNORE_PATHS = [ '/accounts/', # all URLs that start with /accounts/ '/admin/', # all URLs that start with /admin/ ]
Add the following to your urls:
python manage.py migrate
Register your application at https://api.orfium.com/oauth/applications/ and make sure you specify the client type as
and the authorization grant type as
You may use the
API_ORFIUM_ENDPOINT setting if you want your application to use an alternative endpoint such as
By default the endpoint is set to
<YOUR_APP_BASE_URL>/accounts/orfium_oauth2/login/callback/ as the redirect URI.
Update your sites info under
Sites in the admin and create a new social application for the Orfium provider,
using the App ID and Token you got from the previous step.