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
815 stars 203 forks source link

[FEATURE-REQUEST] Add ability to provide tenant as a parameter when calling acquire Token #368

Open g2vinay opened 3 years ago

g2vinay commented 3 years ago

Hi,

Feature Requested:

We're looking to pass in authority URL and tenant to the MSAL clients as parameters to acquire/get token calls to both Confidential and Public Clients. Currently, the authority URL gets locked in when the Confidential and Public Clients are constructed/instantiated and cannot be changed without constructing another instance of the MSAL clients.

It would simplify things if the user could override the authority URL and tenant as part of the parameters passed to the acquire token calls of the MSAL clients.

.NET MSAL supports this feature, it would be great if Python MSAL supports this too.

bgavrilMS commented 3 years ago

Algorithm for resolving authority in MSAL .NET is encapsulated here

jeevanbalanmanoj commented 3 years ago

@bgavrilMS is there an ETA for this feature?

bgavrilMS commented 3 years ago

Just a small update on this one. In MSAL.NET we're deprecating this feature, and replacing it with:

The reason for deprecation is that it is not logical for the app and the request to target different environments (e.g. app targes public cloud, request targets DE cloud). Adding validation around these corner case scenarios is quite difficult and perf intensive. Changing only tenant ID is simpler.