Implementing Single Sign On (SSO) using Django
Solution 1
We're using OpenAM. http://forgerock.com/openam.html
The OpenAM Cookie means that the user is authenticated.
An authentication backend for this is pretty simple. Under 50 lines of code.
https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#other-authentication-sources
We wrote a little bit of code that makes a RESTful request to the OpenAM server to get the user, group and role information. We then use the roles to determine the user's authorizations.
Solution 2
MamaCAS appears to be a good solution. (It has gained 104 stars at the time of writing.)
https://github.com/jbittel/django-mama-cas
MamaCAS is a Django Central Authentication Service (CAS) single sign-on and single logout server. It implements the CAS 1.0, 2.0 and 3.0 protocols, including some of the optional features.
CAS is a single sign-on and single logout web protocol that allows a user to access multiple applications after providing their credentials a single time. It utilizes security tickets, unique text strings generated and validated by the server, allowing applications to authenticate a user without direct access to the user's credentials (typically a user ID and password).
Solution 3
Take a look at django-cas-provider + django-cas-consumer (or django-cas)
Solution 4
django-sso is a pretty neat package that implements single signon
Solution 5
Django Simple SSO is another one.
https://github.com/aldryn/django-simple-sso
article about how to use this repo a article
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on February 25, 2021Comments
-
Admin over 3 years
I would like to use Django for implementing Single Sign On (SSO) for multiple applications that we currently use. How can I implement this using Django?
-
B Robster over 9 yearsAt this point, using authentication libraries that haven't been touched in years seems like a bad idea, since new vulnerabilities typically come to light every year and things get broken as django comes out with new versions.
-
nu everest almost 8 yearsdjango-mama-cas is fresh and maintained stackoverflow.com/a/36539275/1783439
-
Nautatava Navlakha over 4 yearsI dont think django-mama-cas isn't active now. It's been almost 9 months since the last commit. Issues have also been pending since. Looks like github.com/onelogin/python3-saml is being maintained.
-
shiv shankar keshari almost 4 yearsgiven link not working....