WindowsIdentity and Classic .Net App Pool

前端 未结 2 1708
孤城傲影
孤城傲影 2020-12-07 03:45

I have a ASP.NET website that requires my App Pool be the Classic .Net App Pool. The site is running on .NET 3.5 on IIS 7. When I try to get the Active Directory User name o

2条回答
  •  温柔的废话
    2020-12-07 04:18

    If the same code is being used and it works in one application pool and not the other, I would check the application pool's settings. Look for the Identity attribute. I imagine, under the .NET 4.0 pool, you'll have ApplicationPoolIdentity and under the 3.5, you have a hard coded account.

    Edit

    So it sounds like you aren't really getting the users credentials. Of course you get the Domain account when you run locally....the process is running under you credentials. But when you run on another machine, it is running under the credentials of the account that processes the request...until you tell it to impersonate the user. And even then, you may have to set up Windows Authentication for the site to grab the credentials or use forms authentication with an AD hook to get everything under the current user account.

提交回复
热议问题