So I'm trying to get a logged in user's User.Identity.Name. My computer is on a domain and I am logging in using domain credentials.
I've implemented the following service into Startup.cs:
services
.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
I also added the following lines:
app.UseAuthentication();
app.UseAuthorization();
I then use the following within an API controller:
[HttpGet]
public String Get()
{
return User.Identity.Name;
}
When I launch the application, it will not accept my logged in user credentials. It will only accept my other domain account that has local administrator access. Is this expected behavior? How can I fix this?
I remember this working fine in VS2017 and Asp.Net. I'm currently using VS2019 with Core 3.1
Thanks