Specify that the web application will run with the impersonation credentials specified
in the registry subkey that we have made. This is done by putting the following
entry in the Web.config file of the web application:
<identity
impersonate="true"
userName="registry:<subkey>,userName"
password="registry: <subkey>,password"
/>
This entry must be made under the <system.web> section. Here is an example:
<configuration>
<system.web>
<!--
AUTHENTICATION
This section sets the authentication policies of the application. Possible modes
are "Windows", "Forms", "Passport" and "None"
-->
<authentication mode="Windows" />
<identity impersonate="true"
userName=
"registry:HKLM\SOFTWARE\DIS\Identity\ASPNET_SETREG,userName"
password=
"registry:HKLM\SOFTWARE\DIS\Identity\ASPNET_SETREG,password"
/>
<!--
OTHER system.web SETTINGS -->
</system.web>
<!--
OTHER configuration SETTINGS -->
</configuration>
As expected, the entry for a Windows 7, 64 bit machine with our example will be:
<configuration>
<system.web>
<!--
AUTHENTICATION
This section sets the authentication policies of the application. Possible modes
are "Windows", "Forms", "Passport" and "None"
-->
<authentication mode="Windows" />
<identity impersonate="true"
userName=
"registry:HKLM\SOFTWARE\Wow6432Node\DISNG\Identity\ASPNET_SETREG,userName"
password=
"registry:HKLM\SOFTWARE\Wow6432Node\DISNG\Identity\ASPNET_SETREG,password"
/>
<!--
OTHER system.web SETTINGS -->
</system.web>
<!--
OTHER configuration SETTINGS -->
</configuration>
|