Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-microsoft-sso

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-microsoft-sso

Easily add Microsoft Authentication to your Django Projects

  • 5.0.0
  • PyPI
  • Socket score

Maintainers
1

Django Microsoft SSO

Easily integrate Microsoft Authentication into your Django projects

PyPI Build PyPI - Python Version PyPI - Django Version

Welcome to Django Microsoft SSO

This library aims to simplify the process of authenticating users with Microsoft in Django Admin pages, inspired by libraries like django_microsoft_auth and django-admin-sso


Documentation


Install

$ pip install django-microsoft-sso

Configure

  1. Add the following to your settings.py INSTALLED_APPS:
# settings.py

INSTALLED_APPS = [
    # other django apps
    "django.contrib.messages",  # Need for Auth messages
    "django_microsoft_sso",  # Add django_microsoft_sso
]
  1. In Microsoft Entra Administration Center create a multi-tenant app registration and at Application Register, retrieve your Application ID. Navigate to Certificate & secrets link, and get the Client Secret Value. Add both in your settings.py:
# settings.py

MICROSOFT_SSO_APPLICATION_ID = "your Application ID here"
MICROSOFT_SSO_CLIENT_SECRET = "your Client Secret Value here"
MICROSOFT_SSO_SCOPES = ["User.Read.All"]
  1. Add the callback uri http://localhost:8000/microsoft_sso/callback/ in your Microsoft Console, on the "Authorized Redirect URL".

  2. Let Django Microsoft SSO auto create users for allowable domains:

# settings.py

MICROSOFT_SSO_ALLOWABLE_DOMAINS = ["contoso.com"]
  1. In urls.py please add the Django-Microsoft-SSO views:
# urls.py

from django.urls import include, path

urlpatterns = [
    # other urlpatterns...
    path(
        "microsoft_sso/", include("django_microsoft_sso.urls", namespace="django_microsoft_sso")
    ),
]
  1. And run migrations:
$ python manage.py migrate

That's it. Start django on port 8000 and open your browser in http://localhost:8000/admin/login and you should see the Microsoft SSO button.


License

This project is licensed under the terms of the MIT license.

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc