Enable user sign-in to your Django web app by using Azure AD

Azure Active Directory
Microsoft Authentication Library for Python

Create a Django web app that signs in users by using the Microsoft identity platform. Register a Django web app in an Azure Active Directory (Azure AD) tenant, add a user in the tenant, and sign in the user to a Django web app.

Learning objectives

By the end of this module, you'll be able to:

  • Register a web application in an Azure AD tenant.
  • Configure a Django web application to use its Azure AD tenant's app registration details.
  • Sign in a user to a Django web application to obtain an ID token.


  • Beginner-level Python 3.8+ and the Django web framework
  • An Azure account with an active subscription
  • An Azure AD tenant that you manage as a Global Administrator
  • A user account in your own Azure AD tenant