Skip to content

Commit b9f756b

Browse files
authored
[Identity] Add broker credential to "dev" env group (#42599)
Signed-off-by: Paul Van Eck <[email protected]>
1 parent 6a379f1 commit b9f756b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
### Bugs Fixed
1818

1919
- Fixed an issue where CAE (Continuous Access Evaluation) caches were not properly used by `AuthorizationCodeCredential` and the asynchronous `OnBehalfOfCredential`. ([#42145](https://github.com/Azure/azure-sdk-for-python/pull/42145))
20+
- Fixed an issue where brokered authentication was not included in the `DefaultAzureCredential` chain when `AZURE_TOKEN_CREDENTIALS` was set to `dev`. ([#42599](https://github.com/Azure/azure-sdk-for-python/pull/42599))
2021

2122
### Other Changes
2223

sdk/identity/azure-identity/azure/identity/_internal/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def process_credential_exclusions(credential_config: dict, exclude_flags: dict,
161161

162162
if token_credentials_env == "dev":
163163
# In dev mode, use only developer credentials
164-
dev_credentials = {"visual_studio_code", "cli", "developer_cli", "powershell", "shared_token_cache"}
164+
dev_credentials = {"visual_studio_code", "cli", "developer_cli", "powershell", "shared_token_cache", "broker"}
165165
for cred_key in credential_config:
166166
exclude_flags[cred_key] = cred_key not in dev_credentials
167167
elif token_credentials_env == "prod":

sdk/identity/azure-identity/tests/test_token_credentials_env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
SharedTokenCacheCredential,
1818
WorkloadIdentityCredential,
1919
)
20+
from azure.identity._credentials.broker import BrokerCredential
2021
from azure.identity._constants import EnvironmentVariables
2122

2223

@@ -39,6 +40,7 @@ def test_token_credentials_env_dev():
3940
assert AzureCliCredential in actual_classes
4041
assert AzureDeveloperCliCredential in actual_classes
4142
assert AzurePowerShellCredential in actual_classes
43+
assert BrokerCredential in actual_classes
4244

4345
# Assert no duplicates
4446
assert len(actual_classes) == len(set(actual_classes))

0 commit comments

Comments
 (0)