AzureAD / microsoft-authentication-library-for-python

Microsoft Authentication Library (MSAL) for Python makes it easy to authenticate to Microsoft Entra ID. General docs are available here https://learn.microsoft.com/entra/msal/python/ Stable APIs are documented here https://msal-python.readthedocs.io. Questions can be asked on www.stackoverflow.com with tag "msal" + "python".
https://stackoverflow.com/questions/tagged/azure-ad-msal+python
Other
757 stars 192 forks source link

access OneDrive on behalf of a user #538

Closed GitSumito closed 1 year ago

GitSumito commented 1 year ago

I'd like to access OneDrive on behalf of a user. https://learn.microsoft.com/en-us/graph/auth-v2-user

Login authentication has already succeeded and ACCESS_TOKEN is already in hand. (Authentication is passed via Amazon Cognito with AzureAD authentication)

I am expecting to pass ACCESS_TOKEN to msal and issue another TOKEN. I would like to know which function to use.

(If I had username and password on hand, I would call acquire_token_by_username_password, but since I have TOKEN on hand, I am assuming this part will be replaced.)

rayluo commented 1 year ago

Your knowing that you would need an on-behalf-of flow (OBO) flow is already half way there. Go search that term in MSAL Python's API documentation and you will find the method to call.

GitSumito commented 1 year ago

Thank you!