From 4348985c93a8a36afc93ca427993b24206f4349e Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:57:18 -0500 Subject: [PATCH] Update default broker account sample (#35003) * Update default broker account sample * Update variable name to match previous code sample --- sdk/identity/azure-identity-broker/README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sdk/identity/azure-identity-broker/README.md b/sdk/identity/azure-identity-broker/README.md index 8f8fe7f52cf4..833b01eb96a7 100644 --- a/sdk/identity/azure-identity-broker/README.md +++ b/sdk/identity/azure-identity-broker/README.md @@ -38,14 +38,6 @@ Microsoft Entra applications rely on redirect URIs to determine where to send th ms-appx-web://Microsoft.AAD.BrokerPlugin/{client_id} ``` -## Use the default account for sign-in - -When the `use_default_broker_account` argument is set to `True`, the credential will attempt to silently use the default broker account. If using the default account fails, the credential will fall back to interactive authentication. - -``` -cred = new InteractiveBrowserBrokerCredential(use_default_broker_account=True) -``` - ## Examples ### Authenticate with `InteractiveBrowserBrokerCredential` @@ -64,6 +56,15 @@ credential = InteractiveBrowserBrokerCredential(parent_window_handle=current_win client = BlobServiceClient(account_url, credential=credential) ``` +To bypass the account selection dialog and use the account currently signed into the operating system, set the `use_default_broker_account` argument to `True`. The credential will attempt to silently use the default broker account. If using the default account fails, the credential will fall back to interactive authentication. + +```python +credential = new InteractiveBrowserBrokerCredential( + parent_window_handle=current_window_handle, + use_default_broker_account=True +) +``` + ## Troubleshooting See the Azure Identity [troubleshooting guide][troubleshooting_guide] for details on how to diagnose various failure scenarios.