django-organizations icon indicating copy to clipboard operation
django-organizations copied to clipboard

Integration with django-allauth (social auth)

Open bittner opened this issue 8 years ago • 3 comments
trafficstars

(I'm sorry to be so blunt and ask this before trying it out myself. Forgive!)

The README says:

  • Invitation and registration functionality works out of the box for many situations and can be extended as need to fit specific requirements.

... yet it doesn't mention social authentication, such as django-allauth, explicitly.

How easy is it to integrate social authentication? Would django-allauth work (almost) out of the box?

bittner avatar Oct 07 '17 15:10 bittner

django-organizations doesn't "care" about the authorization system, so it works nicely side by side with social authentication.

The invitation component specifically is where you might need to extend this if, say, you wanted to send invitations over that social media channel rather than via email.

Where you might need to make other changes is allowing someone to register or respond to an invitation to an organization and create their user account - this is where you'll want to extend the backend https://github.com/bennylope/django-organizations/blob/dev/organizations/backends/defaults.py#L108

Provided you want to use social authentication directly in the registration and invitation process it's not quite out of the box but it should be reasonably straightforward to support.

If you have an updated backend for this a PR would be welcome to add for other people looking to integrate this themselves!

bennylope avatar Oct 10 '17 18:10 bennylope

I'm using all-auth for email login/registration (more specifically django-rest-auth, which requires all-auth). I'm not using social logins. Currently, the invitations and registration is handled by django-rest-auth. Do I have to override the INVITATION_BACKEND and REGISTRATION_BACKEND settings and call it a day?

Anything else I'd need to do?

loxllxol avatar Oct 21 '17 04:10 loxllxol

@bittner @loxllxol you can take a look at this open source module which implements both django-organizations and django-allauth for OpenWISP 2 (a recently released open source wifi controller built with python & django).

It's really just a matter of correct setup and integration.

nemesifier avatar Nov 30 '17 17:11 nemesifier