2

Server and Client in the same Domain. I am trying to get client windows identity from Published Web Site on IIS.

WindowsIdentity identity = WindowsIdentity.GetCurrent();
string userNameWithDomain = identity.Name.ToString();
string identityName = HttpContext.Current.Request.LogonUserIdentity.Name;
string userName = HttpContext.Current.User.Identity.Name;

By the Way, I dont want to type username and password to anywhere...

I am already tried below parts and parts combinations but still the web page requires username and password

enter image description here

  • Windows Authentication

enter image description here

if iispool(autotest) is default and windows authentication is enabled result is

userNameWithDomain = "FALAN\Filan"// Server Identity name
identityName = "IIS APPPOOL\autotest"// IIS Pool
userName  = "FALAN\Bilgehan" // After I typed the username and password, this variable gives me the correct answer. However as you can see up, i dont want to type username and password to anywhere
  • IIS Pool

I enter custom account information for iispool

enter image description here

userNameWithDomain = "FALAN\Filan"// Server Identity name
identityName = "FALAN\Filan"// Server Identity name
userName  = "FALAN\Bilgehan" // After I typed the username and password, this variable gives me the correct answer. However as you can see up, i dont want to type username and password to anywhere
  • Web Config

I did identity impersonate="true"

and

I did authentication mode="Windows"

  • Visual Studio

enter image description here

As you can see I couldnt catch correct answer. How Can I Get Client Windows Identity from Published Web Site on IIS without enter username and password?

Thanks...

Bilgehan
  • 305
  • 1
  • 3
  • 13

0 Answers0