How to access user claims in python application code when using build-in authentication for container app

Frank 0 Reputation points
2024-04-25T15:06:08.2133333+00:00

I have a container app which is developed in Python with streamlit. I enabled Azure build-in Authentication ("Easy Auth") with Microsoft Entra ID. The authentication part works fine. However, I want to enable some custom authorization implementation based on logged in user's group. How can I get user claims (such a X-MS-CLIENT-PRINCIPAL-NAME, X-MS-CLIENT-PRINCIPAL-ID, etc headers) in my Python code?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
271 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Frank 0 Reputation points
    2024-05-03T20:36:14.3266667+00:00

    I figured it out. It all depends on what architecture host app is using. In my specific case, I am using streamlit app, so this link does the job.

    0 comments No comments