We have a deployment pipeline for our Azure App Service (python runtime) with a Microsoft Entra ID identity provider for authentication. This works fine in the cloud, but we want to be able to use the same authentication pattern while developing locally.
We are using some of the user claims in the request headers in our backend to identify the client and to authorize the client to access certain information. For example, we are using X-MS-CLIENT-PRINCIPAL-NAME
to display the user name in the UI. (https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-user-identities)
However, these user claims are not available in a local development environment. We are struggling to ‘simulate’ the authentication flow which happens in the cloud in our development environment so that we can properly test certain security features before deploying.
We are looking into whether MSAL (https://learn.microsoft.com/en-us/entra/msal/python/) is a solution, but we cannot quite figure out how to solve this problem. Any ideas on this?