
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
django-epfl-entra-id
Advanced tools
Custom Microsoft Entra ID Authentication Backend for Django.
pip install django-epfl-entra-id
Add mozilla_django_oidc to INSTALLED_APPS:
INSTALLED_APPS = [
...
"django.contrib.auth",
"mozilla_django_oidc", # Load after auth
...
]
Add django_epfl_entra_id authentication backend:
AUTHENTICATION_BACKENDS = ("django_epfl_entra_id.auth.EPFLOIDCAB",)
Register your application in the App Portal and add the OIDC configuration:
TENANT_ID = os.environ["TENANT_ID"]
OIDC_RP_CLIENT_ID = os.environ["OIDC_RP_CLIENT_ID"]
OIDC_RP_CLIENT_SECRET = os.environ["OIDC_RP_CLIENT_SECRET"]
AUTH_DOMAIN = f"https://login.microsoftonline.com/{TENANT_ID}"
OIDC_OP_AUTHORIZATION_ENDPOINT = f"{AUTH_DOMAIN}/oauth2/v2.0/authorize"
OIDC_OP_TOKEN_ENDPOINT = f"{AUTH_DOMAIN}/oauth2/v2.0/token"
OIDC_OP_JWKS_ENDPOINT = f"{AUTH_DOMAIN}/discovery/v2.0/keys"
OIDC_OP_USER_ENDPOINT = "https://graph.microsoft.com/oidc/userinfo"
OIDC_RP_SIGN_ALGO = "RS256"
LOGIN_URL = "/auth/authenticate"
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"
Edit your urls.py and add the following:
urlpatterns = [
...
path("", include("django_epfl_entra_id.urls")),
path("auth/", include("mozilla_django_oidc.urls")),
...
]
Example template:
{% if user.is_authenticated %}
<p>Current user: {{ user.username }}</p>
<form action="{% url 'oidc_logout' %}" method="post">
{% csrf_token %}
<input type="submit" value="logout">
</form>
{% else %}
<a href="{% url 'oidc_authentication_init' %}?next={{ request.path }}">
Login
</a>
{% endif %}
AUTH_PROFILE_MODULE = "userprofile.UserProfile"
Enable these loggers in settings to see logging messages to help you debug:
LOGGING = {
...
"loggers": {
"mozilla_django_oidc": {
"handlers": ["console"],
"level": "DEBUG"
},
"django_epfl_entra_id": {
"handlers": ["console"],
"level": "DEBUG",
},
...
}
Make sure to use the appropriate handler for your app.
FAQs
Custom Microsoft Entra ID Authentication Backend for Django.
We found that django-epfl-entra-id demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.