authentication 元素为 ASP.NET 应用程序配置 ASP.NET 身份验证方案。身份验证方案确定如何识别要查看 ASP.NET 应用程序的用户。mode 属性指定身份验证方案。有关可用的身份验证方案的更多信息,请参见 ASP.NET 身份验证。
默认配置
Machine.config 或根 Web.config 文件中未显式配置下面的默认 authentication 元素。但它是 .NET Framework 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>下面的默认 authentication 元素在 .NET Framework 1.1 版的 Machine.config 文件中配置。
<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>下面的默认 authentication 元素在 .NET Framework 1.0 版的 Machine.config 文件中配置。
<authentication mode="Windows">
<forms
name=".ASPXAUTH"
loginUrl="login.aspx"
protection="All"
timeout="30"
path="/" >
<credentials passwordFormat="SHA1"></credentials>
</forms>
<passport redirectUrl="internal" />
</authentication>