{"id":23330,"library":"azure-identity-broker","title":"Azure Identity Broker Plugin","description":"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.","status":"active","version":"1.3.0","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity-broker","tags":["azure","identity","authentication","wam","broker","windows"],"install":[{"cmd":"pip install azure-identity-broker","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for credential classes like InteractiveBrowserBrokerCredential","package":"azure-identity","optional":false},{"reason":"Required for broker integration","package":"msal[broker]>=1.27","optional":false}],"imports":[{"note":"The broker credential is in the azure.identity.broker submodule, not directly in azure.identity","wrong":"from azure.identity import InteractiveBrowserBrokerCredential","symbol":"InteractiveBrowserBrokerCredential","correct":"from azure.identity.broker import InteractiveBrowserBrokerCredential"}],"quickstart":{"code":"import os\nfrom azure.identity.broker import InteractiveBrowserBrokerCredential\n\ncredential = InteractiveBrowserBrokerCredential(\n    client_id=os.environ.get(\"AZURE_CLIENT_ID\", \"\"),\n    tenant_id=os.environ.get(\"AZURE_TENANT_ID\", \"\"),\n    parent_window_handle=None  # Set to a Windows HWND for UI parent\n)\ntoken = credential.get_token(\"https://graph.microsoft.com/.default\")\nprint(token.token)","lang":"python","description":"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."},"warnings":[{"fix":"Use DefaultAzureCredential or InteractiveBrowserCredential for cross-platform support.","message":"Broker is only supported on Windows (Web Account Manager). On Linux or macOS, InteractiveBrowserBrokerCredential will raise a RuntimeError.","severity":"gotcha","affected_versions":"all"},{"fix":"If running in a GUI application, obtain the HWND of the parent window and pass it as parent_window_handle.","message":"parent_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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use from azure.identity.broker import InteractiveBrowserBrokerCredential for version 1.x.","message":"The 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.","severity":"deprecated","affected_versions":"<1.0.0 (pre-release)"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install azure-identity-broker' and ensure you use 'from azure.identity.broker import InteractiveBrowserBrokerCredential'.","cause":"Missing or outdated azure-identity-broker package, or incorrect import path.","error":"ModuleNotFoundError: No module named 'azure.identity.broker'"},{"fix":"Use AzureCliCredential, DefaultAzureCredential, or InteractiveBrowserCredential instead.","cause":"Running on a non-Windows OS (Linux, macOS) where Web Account Manager is not available.","error":"RuntimeError: Broker authentication is not supported on this platform. Use WAM on Windows."},{"fix":"Provide a valid HWND (integer) or pass parent_window_handle=None if you don't have a parent window.","cause":"The credential constructor requires parent_window_handle; it was omitted or set to None incorrectly.","error":"ValueError: parent_window_handle is required for broker authentication"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}