microsoft-agents-authentication-msal
A msal-based authentication library for Microsoft Agents
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a concrete problem for anyone building agents with the Microsoft 365 Agents SDK that need to call Azure AD-protected services. No known vulnerabilities. Install it if you are using the Microsoft Agents framework and need to authenticate with Azure resources.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.10 and valid Azure AD credentials (client ID, secret/certificate, and tenant ID) configured via environment variables.
- Low friction install with three runtime dependencies.
- Active maintenance: released 15 days ago, last commit 2026-08-13, repository has 1036 stars and is not archived.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most enterprise and open-source scenarios.
last release 2026-07-30 (15 days) · last repo commit 2026-08-13 · 1,036 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 466,871 downloads/mo, #6,501 on PyPI
Alternatives
Verify before relying
pip install microsoft-agents-authentication-msal
from microsoft_agents_authentication_msal import MsalAuth
# Configure with client credentials from environment
auth = MsalAuth(
client_id=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID'),
client_secret=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET'),
tenant_id=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID')
)- Whether token caching behavior and refresh intervals are configurable or automatic.
- Specific scopes and permissions required for different Microsoft services (Teams, Graph API, etc.).
- Support for certificate-based and managed identity authentication beyond client secret flow.
What it is and what it does
This package wraps Microsoft Authentication Library (MSAL) to provide authentication for agents built with the Microsoft 365 Agents SDK. It abstracts the complexity of obtaining and refreshing OAuth tokens from Azure AD, enabling agents to authenticate securely when calling Microsoft services like Teams, Microsoft Graph, and other Azure resources.
The library supports multiple authentication types (client secret, certificate, managed identity) and is designed to integrate with the broader Microsoft Agents framework. It handles token caching and multi-tenant scenarios, allowing agents to operate across different Azure AD tenants. The package is part of a larger SDK ecosystem for building enterprise conversational AI agents.
Use it for
- Authenticate a Teams bot or agent to call Microsoft Graph API on behalf of the organization.
- Enable secure agent-to-agent communication within an enterprise Azure AD tenant.
- Use managed identity authentication in Azure-hosted agents to avoid storing secrets.
- Implement on-behalf-of (OBO) flow so agents can act on behalf of signed-in users.
- Build multi-tenant agents that work across different Azure AD organizations.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a concrete problem for anyone building agents with the Microsoft 365 Agents SDK that need to call Azure AD-protected services. No known vulnerabilities. Install it if you are using the Microsoft Agents framework and need to authenticate with Azure resources.
Install
microsoft-agents-authentication-msal on PyPI
Before you install
Low friction install with three runtime dependencies. Active maintenance: released 15 days ago, last commit 2026-08-13, repository has 1036 stars and is not archived.
Requires Python >= 3.10 and valid Azure AD credentials (client ID, secret/certificate, and tenant ID) configured via environment variables.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most enterprise and open-source scenarios.
Quickstart
pip install microsoft-agents-authentication-msal
from microsoft_agents_authentication_msal import MsalAuth
# Configure with client credentials from environment
auth = MsalAuth(
client_id=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID'),
client_secret=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET'),
tenant_id=os.getenv('CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID')
)
Verify before relying
- Whether token caching behavior and refresh intervals are configurable or automatic.
- Specific scopes and permissions required for different Microsoft services (Teams, Graph API, etc.).
- Support for certificate-based and managed identity authentication beyond client secret flow.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesmicrosoft-agents-hosting-coremsalrequests |
| Maintenance | Actively maintained 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 466,871 / month, #6,501 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Operating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: microsoft_agents_authentication_msal-1.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “azure ad authentication for agents”
- microsoft-agents-authentication-msalProvides MSAL-based authentication for Microsoft Agents, handling…
- fastapi-azure-authAdds Azure Entra ID (formerly Azure AD) authentication and…
- adalADAL for Python authenticates applications with Azure Active…
Give your agent the search over MCP, or paste the wish link into any chat.
More Security packages
Provides Python bindings to the FreeDesktop.org Secret Service API for securely storing and retrieving passwords and secrets through GNOME Keyring, KWallet, or KeePassXC.
MSAL for Python handles OAuth2 and OpenID Connect authentication with Microsoft identity services, managing token acquisition, caching, and refresh for applications integrating with Microsoft Entra ID, Microsoft Accounts, and Azure AD B2C.
joserfc implements JOSE standards (JWS, JWE, JWK, JWT, and related RFCs) for signing, encrypting, and managing JSON-based cryptographic tokens in Python.
Authlib provides a complete implementation of OAuth 1.0, OAuth 2.0, and OpenID Connect 1.0 for building both authentication clients and servers, with built-in support for JWS, JWK, JWA, and JWT standards.
Provides low-level CFFI bindings to the official Argon2 password hashing algorithm for use by libraries and applications that need direct access to Argon2 without higher-level abstractions.
ADAL for Python authenticates applications with Azure Active Directory to obtain tokens for accessing Azure AD-protected resources.
Install only if maintaining existing code that already depends on it, and plan a migration.
See also microsoft-agents-hosting-fastapi · identity · microsoft-agents-hosting-aiohttp · microsoft-agents-hosting-teams · microsoft-agents-hosting-core · streamlit-msal · taktile-auth · msal-extensions