Custom ClaimsPrincipal in Asp.Net 5 (Mvc 6)

How can I override the default value of a Context.Usertype System.Security.Claims.ClaimsPrincipalin Asp.Net 5 (MVC-6)?

I would like to use my custom user type so that it is available in controllers ( HttpContext.User) as well as in Razor ( @User.) views

Any help is greatly appreciated. Thank!)

+4
source share
1 answer

The basic answer is no, it is usually a bad idea to try to implement your own security code; there are many options to help you save a lot of time and save a lot of headaches on the back side.

, - .

, POCO. Identity ( , ), OAuth /. .

, , ClaimTypes , . , , , IPrincipal, .

+1

All Articles