Django user authentication with Azure AD and app roles

1.1k views Asked by At

Outline

I want to integrate Azure Active Directory for authentication and authorization.

Question

How do I integrate the msal library into a Django web app, because the official Azure examples are using Flask?

And how to map the AppRoles I have defined in the Azure AD app registration to Django groups defined in the Django backend?

1

There are 1 answers

0
AlfredoRevilla-MSFT On

There are samples both for Flask and Django. MSAL itself is framework agnostic so it can be used in any. Regarding the app roles claims you can inspect the acquire_token* methods result. It's a dict containing access_token and/or id_token which will contain the role claim.