Skip to content

DefaultAzureCredential configures InteractiveBrowserCredential's tenant#11662

Merged
chlowell merged 1 commit intoAzure:masterfrom
chlowell:ibti
May 27, 2020
Merged

DefaultAzureCredential configures InteractiveBrowserCredential's tenant#11662
chlowell merged 1 commit intoAzure:masterfrom
chlowell:ibti

Conversation

@chlowell
Copy link
Member

Today, when DefaultAzureCredential authenticates a user through InteractiveBrowserCredential, it always authenticates that user in the "organizations" tenant, i.e. that user's home tenant. This PR enables changing that behavior by specifying a tenant through environment variable AZURE_TENANT_ID or a keyword argument to DefaultAzureCredential, interactive_browser_tenant_id (this matches what we have in our .NET library).

Closes #11548

@chlowell chlowell added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels May 27, 2020
@chlowell chlowell requested a review from xiangyan99 May 27, 2020 18:10
@chlowell chlowell requested a review from schaabs as a code owner May 27, 2020 18:10
Copy link
Member

@xiangyan99 xiangyan99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. Just wanted to confirm the kwarg name 'interactive_browser_tenant_id' not 'tenant_id'?

@chlowell
Copy link
Member Author

Yes, the virtues of "interactive_browser_tenant_id" are that it's consistent with our .NET API, clearly indicates where it will apply, and follows the existing pattern of allowing different tenant IDs for different credentials. "tenant_id" suggests it would apply to all credentials.

@chlowell chlowell merged commit fa26e7c into Azure:master May 27, 2020
@chlowell chlowell deleted the ibti branch May 27, 2020 19:31
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request May 27, 2020
…into models_to_submodels

* 'master' of https://github.com/Azure/azure-sdk-for-python:
  Increment package version after release of azure_ai_textanalytics (Azure#11664)
  DefaultAzureCredential can configure InteractiveBrowserCredential's tenant (Azure#11662)
  use CIMultiDict when pickling (Azure#11661)
  [text analytics] update version to b6 (Azure#11660)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Identity Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DefaultAzureCredential does not work for exclude_interactive_browser_credential = False

2 participants