
430
|
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
<credentials>
Example
See the example for the <authentication> element.
Notes
Forms-based authentication is only effective when used in conjunction with the
<authorization> element to deny anonymous users access to pages within the
application.
It’s a good idea to use SSL encryption to protect the forms authentication creden-
tials and cookie to prevent the possibility of these credentials being hijacked. If
you can’t (or don’t want to) use SSL, you should at least reduce the default
timeout value to lessen the likelihood of someone capturing and impersonating
the authentication cookie.
<credentials>
<credentials
passwordFormat="Clear|SHA1|MD5">
</credentials>
Allows you to store one or more sets of credentials in the application (or machine)
configuration file for later use in authenticating requests. The child
<user>
element is used to store the actual credentials.
Scope
Machine, Application
Attribute
passwordFormat
Specifies the format in which passwords will be stored (and compared). Valid
options are
Clear, SHA1, and MD5.
Child Elements
<user>
Example
The example shows the <credentials> element, which is used to store two user
accounts to authenticate against:
<credentials passwordFormat = "SHA1">
<user name="foo" password="794ED3D18464BAFF93F8DED1CFD00D9A2D9FE316"/> ...