Implementing Kerberos and LDAP in Django

Hello everyone,

firstly, i’m very new to Django.

I have developed a Django app that includes a ticket system. Users should only see their own tickets. Now this self service system should be connected to the Microsoft account to enable a single sign on. To do this, the Django app must first be connected to Kerberos and then authenticated using LDAP. However, after extensive searching I cannot find any comprehensible documentation that explains the procedure. That’s why I’m turning to you with the hope that someone can help me.

Many thanks in advance


I tried using the Django Documentation and various other “Docs” which were either outdated or incomplete(like the official django documentation).

First, if you’re looking to use this as an SSO solution, simply authenticating the app using LDAP isn’t going to do it.

If you’re going to allow the browser to have their domain credentials automatically recognized by Django, the server needs to be a member of the domain, the web server needs to be configured to support SPNEGO and provide the REMOTE_USER, and Django needs to be configured for the RemoteUserBackend - and then use LDAP to request whatever additional attributes may be needed (such as group membership).

You won’t find much in the way of Django-specific information about this because very little of it involves Django itself.

There have been a couple of other discussions here about this topic.