Augmenting IPrincipal when using IdentityServer authentication middleware in ASP.NET Core

added by Paul Wheeler
5/30/2019 1:40:11 PM

1 Kicks, 150 Views

This post covers augmenting an authenticated User for use in middleware or when using the [Authorize]-attribute in an MVC-controller. There is an important pitfall to avoid which will produce unexpected results, which I'll cover towards the end. Here's a baseline setup: