Search code examples
azureadal

ADAL python support for windows logged in user


We are currently using the adal python library, and wanted to know if there is any way (or plans of implementing a way) to use the signed in user (windows) for a federated authentication flow.

Such a flow is possible using .Net package link

The end goal would be, instead of acquire_token_with_username_password, maybe something like acquire_token_with_signed_in_user?


Solution

  • Thanks for your research effort on this valuable question (upvoted)!

    It is true that neither ADAL Python nor its cousin MSAL Python supports "picking up windows signed-in user and use it". That feature is known as IWA, traditionally only available in our .Net/C# SDK on Windows platforms. It is theoretically possible to add that into Python too. We don't currently have it in our roadmap, largely because no one asks for it before. In that sense, feel free to go ahead and create an issue for it in our MSAL Python github repo (and you did), so that people in the world (or your spouse) can upvote it, and then we will sort them by +1 votes when we do our future rounds of planning.

    On the other hand, there is already a token cache behavior in ADAL Python and in MSAL Python. If you utilize it, and also build your own persistence layer on top of it (which is very easy in MSAL Python), you can cache the tokens so that you end user would not need to authenticate every time. PS: There is some ongoing effort on providing an even higher level helper for token cache persistence, but that is a different topic.

    Also thanks @mohitdhingra-msft for providing another answer here which is also correct.