Registry / azure / azure-identity-broker

azure-identity-broker

JSON →
library1.3.0pypypi✓ verified 84d ago

A Microsoft Authentication Extensions (WAM) broker plugin for Azure Identity, enabling interactive authentication with Web Account Manager on Windows. Current version 1.3.0, requires Python >=3.9. Released as part of the Azure SDK for Python.

pip install azure-identity-broker
INSTALL
IMPORT
SIG · AZURE-IDENTITY-BRO
A
azure-identity-broker
azurepythonv1.3.0
Install
4.4s avg
Import
827ms
Disk
60MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.850s · 40.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.4s · import 0.804s · 82MB
60MB installed
● package 60MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InteractiveBrowserBrokerCredential
from azure.identity.broker import InteractiveBrowserBrokerCredential
from azure.identity import InteractiveBrowserBrokerCredential
The broker credential is in the azure.identity.broker submodule, not directly in azure.identity

Creates a broker credential and acquires a token for Microsoft Graph. Replace AZURE_CLIENT_ID and AZURE_TENANT_ID environment variables with your app registration values.

import os from azure.identity.broker import InteractiveBrowserBrokerCredential credential = InteractiveBrowserBrokerCredential( client_id=os.environ.get("AZURE_CLIENT_ID", ""), tenant_id=os.environ.get("AZURE_TENANT_ID", ""), parent_window_handle=None # Set to a Windows HWND for UI parent ) token = credential.get_token("https://graph.microsoft.com/.default") print(token.token)
Debug
Known issues
gotchaBroker is only supported on Windows (Web Account Manager). On Linux or macOS, InteractiveBrowserBrokerCredential will raise a RuntimeError.
fix
Use DefaultAzureCredential or InteractiveBrowserCredential for cross-platform support.
affects: all
gotchaparent_window_handle must be a valid HWND (integer) on Windows, or None. Omitting it or passing an invalid handle may cause the broker UI to not appear properly.
fix
If running in a GUI application, obtain the HWND of the parent window and pass it as parent_window_handle.
affects: >=1.0.0
deprecatedThe azure.identity.broker module was introduced to separate broker-specific credential from azure-identity. Previous version (0.x) had this credential in the main azure.identity package.
fix
Use from azure.identity.broker import InteractiveBrowserBrokerCredential for version 1.x.
affects: <1.0.0 (pre-release)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azure.identity.broker'
Missing or outdated azure-identity-broker package, or incorrect import path.
fix
Run 'pip install azure-identity-broker' and ensure you use 'from azure.identity.broker import InteractiveBrowserBrokerCredential'.
RuntimeError: Broker authentication is not supported on this platform. Use WAM on Windows.
Running on a non-Windows OS (Linux, macOS) where Web Account Manager is not available.
fix
Use AzureCliCredential, DefaultAzureCredential, or InteractiveBrowserCredential instead.
ValueError: parent_window_handle is required for broker authentication
The credential constructor requires parent_window_handle; it was omitted or set to None incorrectly.
fix
Provide a valid HWND (integer) or pass parent_window_handle=None if you don't have a parent window.
Upgrade
Version history
1.3.0latest on PyPI · released Aug 7, 2025
Audit
Dependencies
azure-identityrequiredRequired for credential classes like InteractiveBrowserBrokerCredential
msal[broker]>=1.27requiredRequired for broker integration
Agent activity
33 hits · last 30 days
node
28
OpenAI (training)
1
Resources
azure-identity-broker — pip install azure-identity-broker · libregistry