Library / SDK
AzureAD/microsoft-identity-web avatar
AzureAD/microsoft-identity-web

Microsoft Identity Web: the ASP.NET Core glue between your app and the Microsoft identity platform

Helps creating protected web apps and web APIs with Microsoft identity platform and Azure AD B2C

789 stars279 forksC#MIT

At a glance

What is it?
Microsoft Identity Web is a NuGet library of reusable classes that sits between an ASP.NET Core application and the Microsoft identity platform, including Azure AD B2C. It covers two shapes of application, web apps that sign users in and protected web APIs, and it comes with a version support policy that makes upgrading a deliberate decision rather than a background chore.
Who is it for?
Microsoft Identity Web fits a .NET team that has decided to use the Microsoft identity platform for sign-in and wants the wiring between ASP.NET Core and the platform handled by a maintained library rather than by hand. It does not fit a team that needs an identity provider outside the Microsoft ecosystem, and it does not remove the need to think about tenant configuration, which the authority configuration guides treat as the single most error-prone area.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the library actually contains

Microsoft Identity Web is a library of reusable classes used with ASP.NET Core to integrate with the Microsoft identity platform, formerly known as the Azure AD v2.0 endpoint, and with Azure AD B2C. It is published on NuGet as Microsoft.Identity.Web and is MIT licensed.

The documentation is explicit about the two situations it is for. The first is web applications, which sign in users and optionally call web APIs. The second is protected web APIs, which optionally call protected downstream web APIs. That second point is the one people miss, because the chained scenario of a web app calling a web API which calls another web API is where token forwarding and audience validation get involved, and having a library that covers both ends is the point of it.

The repository is organised around a wiki rather than a docs site, with conceptual documentation, a getting started page, sample code for web apps and for web APIs, and a reference that points at the Microsoft Learn API documentation for the Microsoft.Identity.Web namespace. The samples are separate from the library, which is a reasonable arrangement for a project whose main artefact is a NuGet package.

The primary language is C#, the default branch is master, and the last push was on 2026-10-21 with the most recent releases being 4.16.1 and 4.16.0 in October 2026.

The support matrix is the part to read first

The README carries a version lifecycle and support matrix, and it is unusually specific.

The table lists the major versions currently supported and receiving security fixes, with a column for the last release, the patch release date, the support phase and the end of support. The 3.x line is the supported one, with monthly patch releases, an active support phase and end of support not planned. It also records that versions from 3.0.0 are supported and that versions below 3.0.0 are not, which is a direct warning if you found this library on an older tutorial.

The support SLA is spelled out underneath. Major versions are supported for twelve months after the release of the next major version, and minor versions older than N-1 are not supported, because minor versions are bugfixes or features with non-breaking additive API changes and it is expected that apps can upgrade, so old minor versions are not patched. The documentation adds a practical instruction you will not find in most libraries: in an issue reproduction you should confirm you are on the latest minor version before the team spends time investigating, because the library moves fast enough that an old minor version is a common cause of a report that turns out to be fixed already.

Semantic versioning is used so that you can control the risk of updating, and the release notes and roadmap live in the wiki, which is a reminder that for a library with a monthly patch cadence the wiki is the living document.

Authority configuration, documented as the hard part

The README states plainly that getting authentication authorities right matters for Azure AD, B2C and CIAM applications, and then it points at a set of documents on the subject.

There is a comprehensive guide explaining how Authority, Instance and TenantId work together, a document of B2C authority examples with configuration patterns and best practices, a document of CIAM scenarios with custom domains, a migration guide for upgrading existing applications and resolving configuration conflicts, and a FAQ on authority precedence with common questions and troubleshooting tips.

That is a significant amount of documentation on one topic, and it is a signal. Authority resolution is where the difference between a working integration and a broken one lives, because the same library behaves differently depending on which of the three settings wins and in what order, and the same application behaves differently on a multi-tenant endpoint, a single tenant and a B2C tenant with a custom domain.

The CIAM examples are the newest addition to that set, and customer identity access management with custom domains is a case where the defaults that work for a single tenant application quietly do not work, because a custom domain changes the issuer the tokens carry and therefore the audience a downstream API must validate against.

Where Microsoft Identity Web is the wrong choice

The first limitation is that the choice of identity provider is made for you. The library is a front end for the Microsoft identity platform, so a team that has standardised on Okta, Auth0, Keycloak or a home grown OIDC server gets no benefit from it, and would use the generic ASP.NET Core OpenID Connect handlers instead.

The second is that it is a security-critical dependency with a fast cadence and a staged support policy. That combination is a feature for a platform team that will stay current, and a burden for a team that upgrades annually, because the 3.x line and everything below it is a moving target and the documentation explicitly declines to patch old minor versions.

The third is that the library removes boilerplate rather than decisions. It gives you the wiring, the token validation, the sign-in flow and the samples, and it leaves you with the questions that actually determine whether your application is secure: which authority, which tenant, which flows, which claims you trust, and what happens when a user is removed from the directory. The authority configuration documentation is long precisely because those decisions are not defaults, and the migration guide for authority versus instance exists because applications get that wrong in ways that are hard to diagnose from a stack trace.

The comparison with the platform SDKs directly is fair. Using the underlying identity platform libraries without this layer means writing the same middleware, cookie handling and token validation yourself, and the case for this library is that Microsoft maintains it against the platform's own changes.

Editorial conclusion

Microsoft Identity Web fits a .NET team that has decided to use the Microsoft identity platform for sign-in and wants the wiring between ASP.NET Core and the platform handled by a maintained library rather than by hand. It does not fit a team that needs an identity provider outside the Microsoft ecosystem, and it does not remove the need to think about tenant configuration, which the authority configuration guides treat as the single most error-prone area. Before adopting it, read the support matrix for the version you would start on, because the 3.x line is the supported one and older versions are not, and work through the authority precedence guide before you write configuration, since the order in which Authority, Instance and TenantId are resolved is where most integration bugs live.

Frequently asked questions

What is Microsoft Identity Web and what is it for?

It is an MIT licensed library of reusable classes used with ASP.NET Core to integrate with the Microsoft identity platform and Azure AD B2C. It is for two situations: web applications that sign in users and optionally call web APIs, and protected web APIs that optionally call protected downstream web APIs.

Which versions of Microsoft Identity Web are supported?

The support matrix lists the 3.x line as currently supported and receiving security fixes with monthly patch releases, and states that versions below 3.0.0 are unsupported. Major versions are supported for twelve months after the release of the next major version, and minor versions older than N-1 are not patched.

Why does the project document authority configuration so heavily?

Because the README calls it crucial for Azure AD, B2C and CIAM applications, and it points at a guide on how Authority, Instance and TenantId work together, plus B2C and CIAM examples, a migration guide for authority versus instance, and an FAQ on precedence. It is the area where most integration problems originate.

How do I get help with Microsoft Identity Web?

The repository is the correct place to file issues, and the README recommends asking questions on Stack Overflow first using the web-app, web-api and asp.net-core tags, and browsing existing issues to see whether the question has already been asked. Feature requests go to GitHub issues, and there is a User Voice page for recommendations.

How do I use the Microsoft Identity Web library?

The conceptual documentation and a getting started page are in the repository wiki, with code samples for web apps and for web APIs, and the API reference is on Microsoft Learn for the Microsoft.Identity.Web namespace. The package itself is installed from NuGet as Microsoft.Identity.Web.

Official sources

  1. AzureAD/microsoft-identity-web on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/azuread-microsoft-identity-web.svg)](https://hysenlabs.com/projects/azuread-microsoft-identity-web)

Was this useful?