Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a project that is using windows authentication method for user to login to the web application. My server is running IIS6. No matter which pc i am using, i will login to the same windows account instead of my pc username. What should i do? Here are the steps that i had done:

1. Create a new application pool
2. Create a new virtual directory and create the application
3. Direct my web application to the application pool
4. Enabled anonymous user
5. Identity impersonate set to true
6. Authentication set to windows

web.config code (full):

<?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
        <appSettings>
            <add key="ChartImageHandler" value="storage=file;timeout=20;"/>
    	</appSettings>
        <connectionStrings>
    		<add name="Appraisal_System" connectionString="Data Source=database;Initial Catalog=mytable;User ID=uid; Password=passw"></add>
    	</connectionStrings>
    	<system.web>
      <httpHandlers>
       <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        validate="false" />
      </httpHandlers>
      <pages>
       <controls>
        <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
         assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
       </controls>
      </pages>
      <compilation debug="true" targetFramework="4.0">
    			<assemblies>
    				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			</assemblies>
    		</compilation>
    		<httpRuntime enableKernelOutputCache="false"/>
    		<authentication mode="Windows"/>
    		<identity impersonate="true"/>
    		<membership>
    			<providers>
    				<clear/>
    				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
    			</providers>
    		</membership>
    		<profile>
    			<providers>
    				<clear/>
    				<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
    			</providers>
    		</profile>
    		<roleManager enabled="false">
    			<providers>
    				<clear/>
    				<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
    				<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
    			</providers>
    		</roleManager>
    	</system.web>
    	<system.webServer>
    		<validation validateIntegratedModeConfiguration="false" />
    		<modules runAllManagedModulesForAllRequests="true" />
      <handlers>
       <remove name="ChartImageHandler" />
       <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
        path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </handlers>
     </system.webServer>
    </configuration>
things that i tried:

- changing the identity impersonate to false (but there's this security popup everytime and i cannt login)
- changing my code to response write and find the username of the pc (all displays e window acc that anonymous enabled)
Posted

1 solution

In IIS Make sure the Anonymous access check box is not selected and that Integrated Windows authentication is the only selected check box.


Follow the link to get your concepts clear..

http://msdn.microsoft.com/en-us/library/ff647405.aspx[^]
 
Share this answer
 
Comments
huatsin 24-Apr-12 3:46am    
just tried, its not working.. it keeps giving a security popup that i couldnt even login with my pc login..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900