- Home
- Download
- _Source Code (Payhip)
- _Payhip
- Category
- _C#
- _ASP.NET MVC
- _ASP.NET Core 2.2
- _ASP.NET Core 3.0
- Blazor
- _Blazor All Topics
- _Radzen Blazor
- _Syncfusion Blazor
- _Blazored
- JQuery
- _Kendo UI
- _Kendo UI ComboBox
- _Kendo UI Grid
- _Kendo UI Window
- _Kendo UI DatePicker
- _AmCharts
- SQL
- Reporting
- _RDLC Report
- _Crystal Report
- _All Reports
- Courses
- _Download Courses
- Blog
- Result
- Contact
- About Me
1 Comments
I am getting Error on Post Method where Identity is Null
ReplyDelete[HttpPost("Post")]
//[Authorize(Roles = "User")]
public string Post()
{
var identity = HttpContext.User.Identities as ClaimsIdentity;
//var identity = _httpContextAccessor.HttpContext.User.Identities as ClaimsIdentity;
IList claim = identity.Claims.ToList();
var userName = claim[0].Value;
return "Welcom To : " + userName;
}