Any possible way of single sign on service with django rest framework? Any possible way of single sign on service with django rest framework? django django

Any possible way of single sign on service with django rest framework?


I've run into the same scenario with our Django and DRF-based projects, and we wanted to implement Single sign-on using JWT. Since the djangorestframework-jwt library had very little focus on providing SSO capabilities between different projects, I have created a new library for this that properly sets up trust definitions and public/private key pairs.

This library provides two types of JWT tokens:

  1. non-expiring session tokens for your primary login application (aka. "refresh tokens")

  2. short-lived authorization tokens for accessing your other apps (these contain permissions given by the primary app)

The client is expected to first login to your primary login application by POSTing an username and password. The client will receive a permanent session token that will allow subsequent requests to the same server be authenticated. These tokens do not contain any permissions/authorization information and cannot be used for SSO into other apps.

Afterwards, the client is expected to obtain and keep updating authorization tokens using the session token. These secondary tokens are short-lived (15mins..1 hour) and contain the permissions that the user has at the time of issuance. These tokens are used to access other services, which then trust the permissions in the JWT payload for the lifetime of the token.

The current version is v0.0.3 (alpha), but we are moving very fast towards a beta and finally production quality release. The API is already relatively stable and should be final by June 30th 2016. The framework will also have full test coverage in the coming weeks, when we reach the beta stage.

Please check the project page and github for the README.

https://pypi.python.org/pypi/djangorestframework-sso

https://github.com/namespace-ee/django-rest-framework-sso

Please let me know if this would fit your use case, and if it has all the features required. I'll be happy to help with the setup.