
428
|
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
<forms>, <passport>
Example
The example configures the pages within the scope of the configuration file to use
ASP.NET forms-based authentication:
<configuration>
<system.web>
<authentication mode="Forms">
<forms name="myAuthCookie"
loginUrl="login.aspx"
protection="All"
timeout="30"
path="/" />
</authentication>
</system.web>
</configuration>
Notes
The <location> element can be used to configure authentication at the machine
level, if desired, and its
allowOverride attribute can be used to prevent overriding
these settings in individual applications.
Authentication can be a fairly involved topic. For more information on the various
ASP.NET authentication methods and how they relate to IIS authentication,
please see Chapter 9.
<forms>
<forms
loginUrl=String
name=String
path=String
protection="All|None|Encryption|Validation"
requireSsl=boolean
slidingExpiration=boolean
timeout=Integer>
</forms>
Provides attributes and one child element (<credentials>) to configure ASP.NET
to use forms-based authentication.
Scope
Machine, Application
Attributes
name
Specifies the name of the authentication cookie. If this attribute is omitted,
the value defaults to
.ASPXAUTH. When running multiple applications that use
forms-based authentication on the same server, ...