MSAL for .NET acquires OAuth2 and OpenID Connect tokens so apps can call protected APIs. It targets the Microsoft identity platform and supports Azure AD B2C scenarios.
Overview
The Microsoft Authentication Library for .NET helps desktop, mobile, and server-side .NET code sign users in and obtain access tokens for resource APIs. It implements industry-standard OAuth2 and OpenID Connect flows against Microsoft Entra ID (formerly Azure AD) and can be configured for consumer and workforce tenants as well as Azure AD B2C policies.
Applications construct public or confidential client instances, perform interactive or silent token acquisition, and cache results according to MSAL's account and token cache model. The library integrates with higher-level wrappers such as Microsoft.Identity.Web and identity SDK extensions used in .NET web and MAUI apps.
Release policy distinguishes major and minor versions: majors receive security fixes for a defined window after successors ship, and teams are steered toward current minors for patches. Optional reduced logging moves selected informational traces to verbose channels when an environment flag is set at process start.
Distribution is via NuGet packages with samples published for common app types. MSAL itself does not host login UI beyond what your app provides; it handles protocol exchanges, authority metadata, and token lifecycle concerns so callers can authorize HTTP requests to Microsoft Graph and other protected endpoints.
Key features
- OAuth2 and OpenID Connect token acquisition
- Microsoft Entra ID and B2C support
- Microsoft.Identity.Web integration path
- Optional reduced diagnostic logging
- NuGet packaging with semantic versioning
- Documented performance testing approach
Use cases
- Calling Microsoft Graph from .NET apps
- Signing users into .NET web APIs
- Desktop or MAUI apps using Entra ID
- Business-to-consumer flows with Azure AD B2C
- Securing backend services with acquired tokens