
<passport> | 431
web.config
Reference
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
You can use the static (shared) HashPasswordForStoringInConfigFile method of
FormsAuthentication to create an MD5 or SHA1 hash of the password for storing
in the
<user> element. When using the <credentials> element to store creden-
tials, you should always hash passwords, since storing them in readable text
presents a potential security risk. Although theoretically, no one should be able to
read the configuration file, a server misconfiguration or security vulnerability
could conceivably expose this file.
<user>
Stores the username and password for each user defined in the <credentials>
element.
Scope
Machine, Application
Attributes
name
The username to be authenticated against.
password
The password to be authenticated against.
Child Elements
None
Example
See the example for the <credentials> element.
Notes
You should always use the HashPasswordForStoringInConfigFile method to hash
passwords stored in the password attribute. A utility page that creates SHA1 or
MD5 hashes of plain text passwords is provided in the examples for Chapter 9.
<passport>
<passport redirectUrl=Url />
This optional element configures an internal URL to which unauthenticated
requests will be redirected when using Microsoft’s Passport authentication
provider. This element should be used