Token Store with Azure Active Directory

Fadli Aulawi Al-ghiffari 20 Reputation points
2024-07-17T06:25:44.9533333+00:00

I am writing a Python code in my app service that has already been integrated with the authentication method, using Microsoft as an identity provider. It says that it has a Token Store option, it seems that I can store and get the credentials each time the user logs in to my apps. I need the token (or any credentials) because in my code, there are different logics for each user. How can I access the token? I use the streamlit library from Python to run my program. Thank you

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Entra | Other
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshu katara 16,565 Reputation points MVP Moderator
    2024-07-17T07:07:59.1333333+00:00

    Hi , Welcome to MS Q&A

    To access the authentication token in your Python app service that uses Microsoft as an identity provider, you can use the access_token property of the request object. This property contains the access token that was obtained during the authentication process. You can access it in your Python code like this:

    access_token = request.access_token
    

    You can then use this access token to make authenticated requests to Microsoft Graph API or other Microsoft services.

    For more information, you can refer to the Quickstart: Sign in users and call Microsoft Graph from a Python Flask web app guide.

    References: https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview?source=recommendations

    Please let me know if any further questions

    Thanks
    Deepanshu

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.