1

Do you know why when I use:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

on a .aspx.cs page in local machine it returns my user name, for example "CORP\323432" and when I publish the same code on server with IIS it returns the IIS and Web Site“s Name ? For example: "IIS SERVER\SITE"

SharpC
  • 6,974
  • 4
  • 45
  • 40
PoorChristmas
  • 55
  • 1
  • 2
  • 9

1 Answers1

0

It is because this is the username that actually runs IIS code, so if you are going to provide privileges to something you should do it to this user or group. Check this out:

https://learn.microsoft.com/en-us/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis

juandimr
  • 96
  • 1
  • 3