Blog Logo
TAGS

Using Azure Functions Middleware to Access ClaimsPrincipal in Azure Static Web Apps

Learn how to access client principal data in Azure Static Web Apps using Azure Functions middleware. This functionality provides authentication-related user information that can be accessed directly or through associated Azure Functions. The client principal data is accessible through the x-ms-client-principal Http Header and can be converted into a ClaimsPrincipal instance for easy interrogation. In this blog post, youll find code examples for accessing the header in C# and in out-of-process models. The updated version of the client principal data processing method is also included as an extension method for easier usage. Check out the GitHub repository for the full code - https://github.com/WestDiscGolf/ClaimsPrincipalAccessor.