简体   繁体   中英

Why does IIS seem to be elevating the WindowsIdentity of one request from the AppPool to my user account?

I am currently working on an ASP .NET application which involves the user logging in using Windows Authentication. This causes both the HTTPContext.User and Thread.Principal to be set with the same credentials as the user logging in which is expected behaviour, while the WindowsIdentity stays as the IIS .NET AppPool user.

I have recently noticed in the application logs that there appears to be one request (normally the 5th-ish request on loading the page) where the WindowsIdentity starts off as the IIS user but ends up being elevated to the user who is logging in.

This only appears to be happening when the user is accessing the root path (for instance http://localhost/ ). If I specify any other exact path such as http://localhost/index.aspx this request does not appear to occur and the WindowsIdentity never changes.

Looking through the (rather large) codebase I can only find one method that impersonates a WindowsIdentity, but that method is not called apart from in specific circumstances on a specific page.

I was wondering why this might be happening and if there was any reason that IIS might be doing it by itself.

按照我觉得我的根(HTTP://本地主机)访问只有管理员用户,因此它被检查的地方是管理员用户或不..,是HTTP:// loclahost如果访问的用户不管理员用户?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM