You develop a Web application. The Web application accesses resources. You create a Microsoft Windows(R) account named AppUser. You grant AppUser appropriate permissions to the resources.
You need to configure the Web application so that it always runs in the context of the AppUser account.
Which code segment should you use?
A)<identity
impersonate="true"
userName="CONTOSO\AppUser"
password="pwd"/>
B)<appSettings>
<add key="userName" value="CONTOSO\AppUser"/>
<add key="password" value="pwd"/>
</appSettings>
C)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Pwd"
password="registry:HKLM\Software\AspNetProcess,Name"/>
D)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Name"
password="registry:HKLM\Software\AspNetProcess,Pwd"/>
A) This would give the user the appropriate permissions on the account.
B) This is more like a global variable that can be used throughout the asp.net pages. For example, setting the database connection information in the web.config.
C & D) Well to impersonate you will need it to be true, and these lines actually save the information to the registry. This is good for storing the user's name and password for the site.
No comments:
Post a Comment