| |||||||||||||||||||||||||||
<authentication> SectionASP.NET Syntax ASP.NET Configuration Sections Configures the ASP.NET authentication scheme that is used to identify users who view an ASP.NET application. <authentication mode = "Windows | Forms | Passport | None">
<forms name = "name" loginUrl = "url"
protection = "All | None | Encryption | Validation"
timeout = "30" path = "/">
<credentials passwordFormat = "Clear | SHA1 | MD5">
<user name = "username" password = "password" />
</credentials>
</forms>
<passport redirectUrl = "internal" />
</authentication>
Attributes and ElementsThe following sections describe attributes, child elements, and parent elements. Attributes
Child Elements
Parent Elements
RemarksThe authentication element configures the ASP.NET authentication scheme for an ASP.NET application. The authentication scheme determines how to identify users who want to view the ASP.NET application. The mode attribute specifies the authentication scheme. For more information about available authentication schemes, see ASP.NET Authentication. Default ConfigurationThe following default authentication element is not explicitly configured in the Machine.config or the root Web.config file. However, it is the default configuration that is returned by the application in the .NET Framework version 2.0. <authentication mode = "Windows">
<forms name = ".ASPXAUTH"
loginUrl = "login.aspx"
defaultUrl = "default.aspx"
protection = "All"
timeout = "30"
path = "/"
requireSSL = "false"
slidingExpiration = "true"
cookieless = "UseDeviceProfile"
domain = ""
enableCrossAppRedirects = "false">
<credentials passwordFormat = "SHA1" />
</forms>
<passport redirectUrl = "internal" />
</authentication>
The following default authentication element is configured in the Machine.config file in the .NET Framework version 1.1. <authentication mode = "Windows">
<forms name = ".ASPXAUTH"
loginUrl = "login.aspx"
protection = "All"
timeout = "30"
path = "/"
requireSSL = "false"
slidingExpiration = "true">
<credentials passwordFormat = "SHA1"></credentials>
</forms>
<passport redirectUrl = "internal" />
</authentication>
The following default authentication element is configured in the Machine.config file in the .NET Framework version 1.0. <authentication mode = "Windows">
<forms name = ".ASPXAUTH"
loginUrl = "login.aspx"
protection = "All"
timeout = "30"
path = "/" >
<credentials passwordFormat = "SHA1"></credentials>
</forms>
<passport redirectUrl = "internal" />
</authentication>
ExampleThe following code example demonstrates how to configure a site for forms-based authentication, specify the name of the cookie that transmits logon information from the client, and specify the name of the logon page to use, if initial authentication fails. You need to include an authorization section to require forms authentication by all users and to deny anonymous users access to the site. <configuration>
<system.web>
<authentication mode = "Forms">
<forms name = "401kApp" loginUrl = "/login.aspx" />
</authentication>
<authorization>
<deny users = "?" />
</authorization>
</system.web>
</configuration>
See AlsoAuthenticationSection Class AuthenticationMode Enumeration ASP.NET Authentication |
| ||||||||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme