Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Register Microsoft Entra ID apps and configure OAuth 2.0 authentication with MSAL integration.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/microsoft-azure-webjobs-extensions-authentication-events-dotnet.md
1# Authentication Events — .NET SDK Quick Reference23> Condensed from **microsoft-azure-webjobs-extensions-authentication-events-dotnet**.4> Full patterns (attribute collection, OTP customization, external data enrichment)5> in the source plugin skill if installed.67## Install8dotnet add package Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents910## Quick Start11```csharp12using Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents;13using Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents.TokenIssuanceStart;1415[FunctionName("OnTokenIssuanceStart")]16public static WebJobsAuthenticationEventResponse Run(17[WebJobsAuthenticationEventsTrigger] WebJobsTokenIssuanceStartRequest request,18ILogger log)19{20var response = new WebJobsTokenIssuanceStartResponse();21response.Actions.Add(new WebJobsProvideClaimsForToken22{23Claims = new Dictionary<string, string> { { "claim", "value" } }24});25return response;26}27```2829## Best Practices30- Validate all inputs — never trust request data; validate before processing31- Handle errors gracefully — return appropriate error responses, don't throw32- Log correlation IDs — use CorrelationId for troubleshooting33- Keep functions fast — authentication events have timeout limits34- Use managed identity — access Azure resources securely35- Cache external data — avoid slow lookups on every request36- Test locally — use Azure Functions Core Tools with sample payloads37- Monitor with App Insights — track function execution and errors38