
432
|
Chapter 20: web.config Reference
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Child Elements
None
Example
This example shows a web.config file that configures an application for Passport
authentication:
<configuration>
<system.web>
<authentication mode="Passport">
<passport redirectUrl="Login.aspx"/>
</authentication>
</system.web>
</configuration>
Notes
For more information on configuring Passport authentication, see the Passport
SDK documentation, which is available from http://www.passport.com.
<authorization>
Provides two child elements, <allow> and <deny>, that allow you to configure the
users, roles, or HTTP verbs that can be used to access application resources.
Scope
Any
Attributes
None
Child Elements
<allow>, <deny>
Example
The example allows users Mary and John to access application resources using
any HTTP verb, while denying POST access to nonauthenticated users:
<configuration>
<system.web>
<authorization>
<allow users="Mary, John" />
<deny users="?" verbs="POST" />
</authorization>
</system.web>
</configuration>
Notes
The type of authorization implemented by the <authorization> element is referred
to as URL authorization. You can read more about URL authorization in
Chapter 9.