Email/First Name and Last Name in ASP.Net Core Controller Side

Shatrughan Raghuwanshi 1 Reputation point
2022-06-27T06:58:55.097+00:00

I am trying to get the E-Mail/First Name and Last Name on the Controller side of ASP.Net Web 

User Name i am getting via 

string UserName = HttpContext.User.Identity.Name;

But i am getting NULL in 

MailId = UserPrincipal.Current.EmailAddress;

FirstName = UserPrincipal.Current.GivenName;

LastName = UserPrincipal.Current.Surname;

Unfortunately our LDAP server is not providing the Mail Address 

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
{count} votes