[Fixed]-Enable oauth login with django-allauth but a custom provider

10👍

This is a interesting article that explains this topic:

9👍

Based on what the documentation says, it discovers new providers based on INSTALLED_APPS. So you will need a Django app that has the same structure yes and includes a providers.py. So you should be able to use a new app or an existing one.

This is from the docs:

When an existing provider doesn’t quite meet your needs, you might
find yourself needing to customize a provider.

This can be achieved by subclassing an existing provider and making
your changes there. Providers are defined as django applications, so
typically customizing one will mean creating a django application in
your project, containing your customized urls.py, views.py and
provider.py files. What behaviour you can customize is beyond the
scope of this documentation.

Also, a note about the contents of the providers.py file:

In your provider.py file, you will need to expose the provider class
by having a module level attribute called provider_classes with your
custom classes in a list. This allows your custom provider to be
registered properly on the basis of the INSTALLED_APPS setting.

Leave a comment