DEV Community

holger
holger

Posted on

Azure SDK for Python: WAM Support in Beta/Pre-Release

Azure Identity 1.13.0b1 is in Pre-Release state

I saw on my GitHub Feed yesterday that the Azure SDK Releases have the azure-identity beta library 1.13.0b1 in pre-release now [2][3].
The Azure Identity beta library 1.13.0b1 should be able to call Web Account Manager (WAM), a component that ships with Windows 10+ and Windows Server 2019+ and acts as an authentication broker allowing users to benefit from integration with accounts known to Windows [1][4].

The beta library can be tested and installed through pip:

pip install azure-identity==1.13.0b1
Enter fullscreen mode Exit fullscreen mode

The class in question is InteractiveBrowserCredential, which does now accept an allow_broker keyword as per the class's documentation below (full details here) [5]:

class InteractiveBrowserCredential(InteractiveCredential):
    """Opens a browser to interactively authenticate a user.

    ...snip...

    :keyword bool allow_broker: Brokers provide single sign-on, device identification, and application identification
        verification. If this parameter is set to True, the broker will be used when possible. Defaults to False.
        Check https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token-wam
        for more WAM information.

    ...snip...

    """
Enter fullscreen mode Exit fullscreen mode

When using allow_broker=True on Windows 10+ or Windows Server 2019+ ...

from azure.identity import InteractiveBrowserCredential
credential = InteractiveBrowserCredential(allow_broker=True)
Enter fullscreen mode Exit fullscreen mode

...the authentication process should try to leverage WAM.
On older Windows versions or Mac/Linux, it should revert to using the browser.

I'm not sure if this functionality will be widely used with the Python SDK, however, according to this GitHub issue, it seems to be part of the Azure SDK design guideline as "the support for WAM must exist in all Tier-1 languages (C#, Java, JS, Python) for Azure Identity SDK" [6].

References

# Title URL Accessed-On
1 Desktop app that calls web APIs: Acquire a token using WAM https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-desktop-acquire-token-wam 2023-01-11
2 Azure SDK Releases https://azure.github.io/azure-sdk/releases/latest/all/python.html 2023-01-11
3 azure-identity 1.13.0b1 https://pypi.org/project/azure-identity/1.13.0b1/ 2023-01-11
4 WAM https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/wam 2023-01-11
5 class InteractiveBrowserCredential(InteractiveCredential) https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/azure/identity/_credentials/browser.py 2023-01-11
6 Add WAM Support to MSAL for Python, for cross-language consistency #451 https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/451 2023-01-11

Top comments (0)