Rockford Lhotka

 Friday, September 8, 2017
« Password keepers and Windows 10 | Main | CSLA .NET 20 Year Anniversary »

ASP.NET Core only works with ClaimsPrincipal. Specifically, the http context from ASP.NET Core only accepts a ClaimsPrincipal instance, not the more general IPrincipal type.

Confusingly, the rest of the .NET world (full .NET, Xamarin, .NET Core, and netstandard2.0) still support IPrincipal. This makes ASP.NET Core an outlier, but an important one.

As a library author, I’m wondering if the consensus is that IPrincipal is dead, and that all principal objects should now subclass ClaimsPrincipal? Is this a new universal truth?

Specifically, should I run through all of CSLA .NET and in the netstandard2.0 version only support ClaimsPrincipal?

This would ultimately affect people building for Xamarin, full .NET, UWP, .NET Core, mono, as well as ASP.NET Core.

This would be a major breaking change for anyone trying to get existing .NET code (using CSLA) to run in any netstandard2.0 environment. The thing is, if you want to use ASP.NET Core you are kind of forced into that major breaking change anyway right?

My first reaction is NO – I shouldn’t make such a big change, because all the platforms not running in ASP.NET Core shouldn’t be forced to accept this burden just because ASP.NET decided to make a low-level breaking change by not supporting the IPrincipal type.

But I’m interested in hearing other people’s thoughts on this. What is the right answer?

Friday, September 8, 2017 3:16:28 PM (Central Standard Time, UTC-06:00)  #    Disclaimer