Add more documentation about setting up social logins
It is not trivial to setup social logins. Add some helper documentation for that.
Yes, so the way social login works in Mailman is by using a library
called Djang-allauth1. There are a few social providers already
"enabled" in the Django configuration for the container images, to add
more you would have change INSTALLED_APPS in your
settings_local.py
. There is no way to "add" any apps as the one
defined in settings_local.py
will override the original one (they are
just python variables), so you'd have to copy the entire INSTALLED_APPS3
and then add whatever new ones you want.
To see a list of all the providers, please have a look at the documentation of django-allauth2. Make sure that the one you choose provides "email" as part of user data, otherwise it won't work with Mailman. e.g. Twitter doesn't give out emails.
Now to be able to use any provider, you'd have to configure them in your site. django-allauth documentation2 does provide instructions and direct urls to configure each one. To summarize the documentation here are the steps:
- Go to your Django admin interface (located at '/admin', like http://example.com/admin) and login with whatever superuser you created.
- Scroll down to the section "SOCIAL ACCOUNTS" and enter the one saying "Social applicationis". The relative url for that is '/admin/socialaccount/socialapp/'
- Click on "ADD SOCIAL APPLICATION" button on the top left of the page.
- Fill out the details from your social provider and choose the "Sites" you want to use for that particular social provider. You can have separate credentials for separate "Sites".
That should be all. Make sure when you request client_id
and
client_secret
from the social providers, you provide the correct
callback_url
. The documentation for django-allauth2 has the correct
url for each provider, but it looks basically like
http://mysite.com/accounts//login/callback
and you replace with amazon, facebook, google or whatever provider.
A copy-paste of an email I sent to help someone setup social logins. Might be helpful for others.