Entra.EventHandlers
1.3.0
dotnet add package Entra.EventHandlers --version 1.3.0
NuGet\Install-Package Entra.EventHandlers -Version 1.3.0
<PackageReference Include="Entra.EventHandlers" Version="1.3.0" />
<PackageVersion Include="Entra.EventHandlers" Version="1.3.0" />
<PackageReference Include="Entra.EventHandlers" />
paket add Entra.EventHandlers --version 1.3.0
#r "nuget: Entra.EventHandlers, 1.3.0"
#:package Entra.EventHandlers@1.3.0
#addin nuget:?package=Entra.EventHandlers&version=1.3.0
#tool nuget:?package=Entra.EventHandlers&version=1.3.0
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 extensions.
🚀 Features
✔ Fluent Response Builders
Strongly‑typed builders for constructing valid Entra responses:
AttributeCollectionStartResponseBuilderAttributeCollectionSubmitResponseBuilderTokenIssuanceStartResponseBuilderEmailOtpSendResponseBuilderPrefillValuesBuilder
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();
✔ Base Handler Infrastructure
Includes:
- Structured logging
- Correlation scoping
- Execution timing
- Protocol validation (
@odata.type) - Consistent exception handling
- Clean override point (
HandleCore)
public class TokenIssuanceStartHandler(ILogger<TokenIssuanceStartHandler> logger)
: TokenIssuanceStartHandlerBase(logger)
{
protected override Task<TokenIssuanceStartResponse> HandleCore(
TokenIssuanceStartEvent request,
CancellationToken cancellationToken)
{
// Extract user ID (GUID)
var userId = request.Data.AuthenticationContext?.User?.Id;
// Example: determine roles based on user ID
var roles = userId switch
{
// Example: special admin GUID
var id when id == Guid.Parse("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
=> ["Admin", "PowerUser"],
// Default
_ => new[] { "User" }
};
// Example: add custom claims
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 — protocol types (MIT)
- Entra.EventHandlers.AzureFunctions — Azure Functions integration (BSL)
- Entra.EventHandlers.AspNetCore — ASP.NET Core hosting adapter (BSL)
🔒 License
This package is licensed under the Business Source License (BSL).
See:
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.
| 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.3.1)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
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 Authentication Event Handlers. Provides request/response adapters, function base classes, DI integration, and minimal boilerplate for building production-ready authentication extensions. |
|
|
Entra.EventHandlers.AspNetCore
ASP.NET Core hosting adapter for Microsoft Entra External ID Authentication Event Handlers. Provides request/response adapters, endpoint base classes, DI integration, and minimal boilerplate for building production-ready authentication extensions. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.0 | 0 | 6/10/2026 |
| 1.2.10 | 61 | 6/8/2026 |
| 1.2.9 | 58 | 6/8/2026 |
| 1.2.8 | 55 | 6/8/2026 |
| 1.2.7 | 64 | 6/7/2026 |
| 1.2.6 | 65 | 6/6/2026 |
| 1.2.5 | 68 | 6/6/2026 |
| 1.2.4 | 71 | 6/5/2026 |
| 1.2.3 | 141 | 6/3/2026 |
| 1.2.0 | 126 | 6/3/2026 |
| 1.1.1 | 125 | 6/2/2026 |
| 1.1.0 | 129 | 6/1/2026 |
| 1.0.31 | 129 | 6/1/2026 |
| 1.0.30 | 124 | 6/1/2026 |
| 1.0.28 | 132 | 5/30/2026 |
| 1.0.25 | 119 | 5/30/2026 |
| 1.0.24 | 120 | 5/30/2026 |
| 1.0.22 | 118 | 5/30/2026 |
| 1.0.21 | 124 | 5/30/2026 |
| 1.0.20 | 127 | 5/29/2026 |
Initial public release of the core implementation for Microsoft Entra External ID Authentication Event Handlers.
Includes fluent response builders, handler base classes, validation, and execution pipeline.