pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.13k stars 2.99k forks source link

`get_app` use client_id for oauth to circumvent multipelobjectsreturned #3912

Open jonathan-s opened 2 weeks ago

jonathan-s commented 2 weeks ago

Providers that implement oauth, and thus use a client id, when making that initial login you could support a get parameters to fetch the client_id from there (if available).

That would make it possible to use several providers of the same type without using different sites.

I would also add that currently you'll get a nasty 500 error as get_app can throw a MultipleObjectsReturned error which doesn't seem to be caught in the views.

Would you accept a patch for these changes?

pennersr commented 2 weeks ago

Thoughts:

pennersr commented 2 weeks ago

MultipleObjectsReturned error which doesn't seem to be caught in the views.

That is indeed not caught as this is considered misconfiguration. The only thing that could be done is to catch it and raise an ImproperlyConfiguredException.