Entra.EventHandlers
1.3.4
dotnet add package Entra.EventHandlers --version 1.3.4
NuGet\Install-Package Entra.EventHandlers -Version 1.3.4
<PackageReference Include="Entra.EventHandlers" Version="1.3.4" />
<PackageVersion Include="Entra.EventHandlers" Version="1.3.4" />
<PackageReference Include="Entra.EventHandlers" />
paket add Entra.EventHandlers --version 1.3.4
#r "nuget: Entra.EventHandlers, 1.3.4"
#:package Entra.EventHandlers@1.3.4
#addin nuget:?package=Entra.EventHandlers&version=1.3.4
#tool nuget:?package=Entra.EventHandlers&version=1.3.4
Entra.EventHandlers
Production‑ready implementation layer for Microsoft Entra External ID Authentication Event Handlers.
This package builds on top of the MIT‑licensed Entra.EventHandlers.Abstractions and provides fluent response builders, base handler infrastructure, and utilities for constructing custom External ID extensions.
This package focuses exclusively on External ID events.
Workforce events are provided separately in Entra.EventHandlers.Workforce.
🚀 Features
✔ Fluent Response Builders
Strongly‑typed builders for constructing valid External ID responses:
AttributeCollectionStartResponseBuilderAttributeCollectionSubmitResponseBuilderTokenIssuanceStartResponseBuilderEmailOtpSendResponseBuilderPasswordSubmitResponseBuilderPrefillValuesBuilder
These builders eliminate manual JSON crafting and ensure protocol‑correct payloads.
✔ Unified Entry Point
A single, discoverable API surface for creating responses:
EntraEventResponses.AttributeCollectionStart();
EntraEventResponses.AttributeCollectionSubmit();
EntraEventResponses.TokenIssuanceStart();
EntraEventResponses.EmailOtpSend();
EntraEventResponses.PasswordSubmit();
✔ Supported External ID Events
- AttributeCollectionStart
- AttributeCollectionSubmit
- TokenIssuanceStart
- EmailOtpSend
- PasswordSubmit
✔ Base Handler Infrastructure
Includes:
- Structured logging
- Correlation scoping
- Execution timing
- Protocol validation (
@odata.type) - Consistent exception handling
- Clean override point (
HandleCoreAsync)
public class TokenIssuanceStartHandler(ILogger<TokenIssuanceStartHandler> logger)
: TokenIssuanceStartHandlerBase(logger)
{
protected override Task<TokenIssuanceStartResponse> HandleCoreAsync(
TokenIssuanceStartEvent request,
CancellationToken cancellationToken)
{
var userId = request.Data.AuthenticationContext?.User?.Id;
var roles = userId switch
{
var id when id == Guid.Parse("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
=> ["Admin", "PowerUser"],
_ => new[] { "User" }
};
var customClaims = new Dictionary<string, object>
{
{ "tenantId", "contoso-eu" },
{ "department", "Engineering" },
{ "roles", roles }
};
return Task.FromResult(
EntraEventResponses
.TokenIssuanceStart()
.ProvideClaimsForToken(customClaims)
.Build());
}
}
✔ Prefill Support
return EntraEventResponses
.AttributeCollectionStart()
.SetPrefillValues()
.Add("email", "user@example.com")
.Add("country", "PL")
.Done()
.Build();
📁 Samples
Sample handler implementations are available in the repository:
👉 Sample.Common
https://github.com/szubajak/entra-event-handlers/tree/main/samples/Sample.Common
These samples demonstrate:
- how to inherit from the Core handler base classes
- how to use fluent response builders (
EntraEventResponses.*) - how to construct block pages, prefill values, and custom claims
- how to structure clean, production‑ready handler logic
They are shared by both the ASP.NET Core and Azure Functions sample applications.
📦 Related Packages
- Entra.EventHandlers.Abstractions — public protocol types (MIT)
- Entra.EventHandlers.Workforce — Workforce‑specific event models and builders (BSL)
- Entra.EventHandlers.AspNetCore — ASP.NET Core hosting adapter (BSL)
- Entra.EventHandlers.AzureFunctions — Azure Functions hosting adapter (BSL)
🔒 License
This package is licensed under the Business Source License (BSL).
See:
LICENSE— full BSL termsLICENSE-COMMERCIAL.md— commercial licensing terms
A commercial license is required for production use by organizations with more than 5 employees.
A commercial license covers the entire Entra Event Handlers ecosystem, including all current and future BSL‑licensed packages.
Commercial License Pricing
- Developer License — €99 / developer / year
- Team License — €399 / year
- Enterprise License — €1499 / year
For commercial licensing or support:
📧 jakub.szubarga@gmail.com
The abstractions package is MIT‑licensed and can be used freely.
📘 Further Reading
For a deeper look into Microsoft Entra External ID Authentication Event Handlers, Workforce scenarios, and the design of this ecosystem, see:
➡️ Entra External ID — .NET Handlers Deep Dive
https://medium.com/@jakub.szubarga/entra-external-id-dotnet-handlers-a7447dc1e437
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Entra.EventHandlers.Abstractions (>= 1.4.1)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Entra.EventHandlers:
| Package | Downloads |
|---|---|
|
Entra.EventHandlers.AzureFunctions
Azure Functions hosting adapter for Microsoft Entra External ID and Workforce Authentication Event Handlers. Provides minimal-boilerplate function routing, request/response adapters, unified execution pipeline, DI integration, structured logging, and production-ready hosting for custom authentication extensions. |
|
|
Entra.EventHandlers.AspNetCore
ASP.NET Core hosting adapter for Microsoft Entra External ID and Workforce Authentication Event Handlers. Provides minimal-boilerplate endpoint mapping, request/response adapters, unified execution pipeline, DI integration, structured logging, and production-ready hosting for custom authentication extensions. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.4 | 50 | 6/26/2026 |
| 1.3.3 | 93 | 6/25/2026 |
| 1.3.2 | 122 | 6/18/2026 |
| 1.3.1 | 142 | 6/11/2026 |
| 1.3.0 | 92 | 6/10/2026 |
| 1.2.10 | 123 | 6/8/2026 |
| 1.2.9 | 117 | 6/8/2026 |
| 1.2.8 | 110 | 6/8/2026 |
| 1.2.7 | 177 | 6/7/2026 |
| 1.2.6 | 120 | 6/6/2026 |
| 1.2.5 | 123 | 6/6/2026 |
| 1.2.4 | 120 | 6/5/2026 |
| 1.2.3 | 154 | 6/3/2026 |
| 1.2.0 | 138 | 6/3/2026 |
| 1.1.1 | 134 | 6/2/2026 |
| 1.1.0 | 139 | 6/1/2026 |
| 1.0.31 | 143 | 6/1/2026 |
| 1.0.30 | 137 | 6/1/2026 |
| 1.0.28 | 139 | 5/30/2026 |
| 1.0.25 | 127 | 5/30/2026 |
Includes fluent response builders, production-ready handler base classes, protocol validation,
structured logging, correlation scopes, and the unified execution pipeline for Microsoft Entra
External ID Authentication Event Handlers. Designed for use with the ASP.NET Core and Azure
Functions hosting adapters.