Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:18:44+00:00 2026-06-16T21:18:44+00:00

We have an IIS 7.5 with the following site structure: WebApp (ASP.NET Forms) =

  • 0

We have an IIS 7.5 with the following site structure:

WebApp (ASP.NET Forms) = Web Site (http://WebApp)
   WebAPI (MVC 4 Web API) = Folder converted to Application (http://WebApp/webapi)

Both are running under the same ApplicationPool.

Both have the same Authentication settings:
– ASP.NET impersonation (authenticated user)
– Windows Authentication (providers: negotiate)

Both web.configs define:

<authentication mode="Windows" />  
<identity impersonate="true" /> 

The WebApp calls a WebService from the WebAPI by using HttpClient:

HttpClient _httpClient = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true });
_httpClient.BaseAddress = new Uri("http://WebApp/webapi/");
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage _response = _httpClient.GetAsync("api/Entity/Get").Result;

and the WebAPI connects to a DB by using MS Enterprise Library.

When I run this localy everything works fine, when I deploy this on the IIS 7.5 server and start remote debugging, my HttpContext Current user in the Web API is the Application Pool Identity instead of the user that is logged on to the Web Application. I ofcourse want it to be the user logged on to the WebApp because I want to use security based on AD account (groups).

Can anyone, please, offer some advice to get this working. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:18:45+00:00Added an answer on June 16, 2026 at 9:18 pm

    The following answer helped us (https://stackoverflow.com/a/10311823/68024) :

    There are two possible ways out of this. If you have access to yours
    server aspnet_config.config, you should set following settings
    (setting those in web.config seems to have no effect):

    <legacyImpersonationPolicy enabled="false"/>
    <alwaysFlowImpersonationPolicy enabled="true"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site using .NET 4 and ASP.NET MVC3 running in IIS
Let's assume the following: I have an IIS web site set up IIS is
I have an existing ASP.NET application that implements Forms Authentication site-wide. The application is
I have the following structure in IIS. Internet Information Services (local computer) Web Sites
I have the following code in a web.config file of the default IIS site.
ASP.NET - IIS 6 - we currently have a public-facing site that has a
I have an ASP.Net MVC 2 site set up under IIS7 using the integrated
I have an ASP.NET web site set up to use windows authentication (not sure
I have added some web methods to my ASP.NET page like the following to
I have configuired PHP 5.3 on IIS 7 using the following instructions: http://www.php.net/manual/en/install.windows.iis7.php and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.