I have an Asp Net core application. I have set the Authentication to Windows Authentication. when I run the app from Visual Studio the WindowsIdentity.GetCurrent().Name
returns my computer name and when I host it on IIS
, it gives the IISAppPool
name. I want to get the user's domain username and store in DB.
The above scenario was when I had the anonymousAuthentication: true
.
Here is when I change it. The launchSettings.json
content for IIS:
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": false,
"iisExpress": {
"applicationUrl": "http://localhost:21021/",
"sslPort": 0
}
I have also added [AbpAllowAnonymous]
on the TokenAuthController
.
Now I am getting a prompt on page load asking for username and password. I do not know what I should add as my username and password. I have already tried my windows username and password but it keeps prompting me for username and password!