Skip to content

Azureclient

flowtask.interfaces.AzureClient

AzureClient

AzureClient(tenant_id=None, client_id=None, client_secret=None, scopes=None, **kwargs)

Bases: ClientInterface

AzureClient

Overview

The `AzureClient` class handles authentication and authorization for Azure Active Directory using the Microsoft
Authentication Library (MSAL). This class provides methods to acquire tokens for secure API requests, particularly
for the Microsoft Graph API. It supports both confidential client applications and user authentication.

.. table:: Properties :widths: auto

+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| Name             | Required | Description                                                                                      |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| tenant_id        |   Yes    | The Azure AD tenant ID. Defaults to AZURE_ADFS_TENANT_ID from the configuration.                |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| client_id        |   Yes    | The client ID of the Azure AD application. Defaults to AZURE_ADFS_CLIENT_ID from the config.    |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| client_secret    |   Yes    | The client secret of the Azure AD application. Defaults to AZURE_ADFS_CLIENT_SECRET.            |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| scopes           |   No     | A list of scopes for the token request. Defaults to Microsoft Graph API scopes.                 |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| authority        |   Yes    | The authority URL for Azure AD authentication. Defaults to Azure AD instance authority.         |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| credentials      |   Yes    | A dictionary containing the credentials for Azure AD authentication.                            |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+

Return

The methods in this class handle the acquisition of access tokens and the configuration of MSAL clients for
interacting with Azure services. The tokens acquired can be used for authenticating API requests to services
like Microsoft Graph.