-
Notifications
You must be signed in to change notification settings - Fork 231
authentication
• back to Documentation Home
The social logins settings will need to be initialized with the proper authentication
parameters. In most cases this involves setting up an account at the provider then
obtaining a CLIENT ID
and a CLIENT SECRET
.
Once the credential information is known Biostar users with staff level permissions can
access the Django admin at http://yoursite.here/admin
and add these credentials
into the Social Applications
table.
Note: The authentication information is stored in the database. Database dumps will contain this potentially sensitive information.
To avoid having to manually add social account settings users can export social authentication related values from their database with:
python manage.py dumpdata socialaccount.socialapp > socialapp.json
Loading these settings would be performed with:
python manage.py loaddata socialapp.json
Biostar uses django-allauth
for authentication. The documentation for it can be found at
http://django-allauth.readthedocs.org/en/latest/providers.html
We demonstrate a few simple examples below
- Ensure that
allauth.socialaccount.providers.google
is listed in yourINSTALLED_APPS
- Access the Google Developer Console: https://cloud.google.com/console/project
- Find the section called
API&auth
- Create a new Client ID.
- Ensure that the
REDIRECT URIS
is set tohttp://yoursite.here/accounts/google/login/callback/
- Add the
CLIENT ID
andCLIENT SECRET
into yourGoogle Social Account
on the Admin site.
Setting up persona authentication is somewhat different from others.
-
Ensure that
allauth.socialaccount.providers.persona
is listed in yourINSTALLED_APPS
-
Ensure that an audience is set up in your settings:
SOCIALACCOUNT_PROVIDERS = { 'persona': { 'AUDIENCE': 'http://yoursite.here/', 'REQUEST_PARAMETERS': {'siteName': 'Your Site Name'} } }