Posts with the “Python” tag

POST

In this article we’ll cover lessons learned implementing a Keycloak authentication solution into Django Rest Framework (DRF) using the mozilla-django-oidc library. Note that this article assumes some familiarity with Django.

Requirements

These can be summarized as follows:

  1. Replace the current authentication solution with a Keycloak-based solution so that users can be authenticated and enable single sign-on between applications using different authentication providers.
  2. The solution should cover both Django (session authentication) and DRF (token authentication).
  3. It should be able to handle a dedicated Keycloak client and expandable to allow roles-based authorisation.
  4. OpenID connect preferred
  5. Any libraries used should be currently supported and widely used