Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update src/azure-cli-core/azure/cli/core/commands/client_factory.py
Co-authored-by: Feiyue Yu <[email protected]>
  • Loading branch information
jiasli and qwordy authored Apr 6, 2021
commit 6071c378b032e3c81dc2774b42f251ef4fb4ecba
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _get_mgmt_service_client(cli_ctx,
# As a temporary workaround, manually add external tokens to 'x-ms-authorization-auxiliary' header.
# https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
if getattr(cred, "_external_tenant_token_retriever", None):
_, _, _, external_tenant_tokens = cred.get_all_tokens(*resource_to_scopes(resource))
*_, external_tenant_tokens = cred.get_all_tokens(*resource_to_scopes(resource))
# Hard-code scheme to 'Bearer' as _BearerTokenCredentialPolicyBase._update_headers does.
client_kwargs['headers']['x-ms-authorization-auxiliary'] = \
', '.join("Bearer {}".format(t[1]) for t in external_tenant_tokens)
Copy link
Member

Choose a reason for hiding this comment

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

Is there a pipeline support?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will make a new policy and add it to the pipeline in the future, utilizing Azure/azure-sdk-for-python#17340.

Expand Down