<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    常用鏈接

    統計

    最新評論

    Windows Authentication

    from http://www.iis.net/ConfigReference/system.webServer/security/authentication/windowsAuthentication

    Overview

    The <windowsAuthentication> element defines configuration settings for the Internet Information Services (IIS) 7 Windows authentication module. You can use Windows authentication when your IIS 7 server runs on a corporate network that is using Microsoft Active Directory service domain identities or other Windows accounts to identify users. Because of this, you can use Windows authentication whether or not your server is a member of an Active Directory domain.

    Windows authentication (formerly named NTLM, and also referred to as Windows NT Challenge/Response authentication) is a secure form of authentication because the user name and password are hashed before being sent across the network. When you enable Windows authentication, the client browser sends a strongly hashed version of the password in a cryptographic exchange with your Web server.

    Windows authentication supports two authentication protocols, Kerberos and NTLM, which are defined in the <providers> element. When you install and enable Windows authentication on IIS 7, the default protocol is Kerberos. The <windowsAuthentication> element can also contain a useKernelMode attribute that configures whether to use the kernel mode authentication feature that is new to Windows Server 2008.

    Windows authentication is best suited for an intranet environment for the following reasons:

    • Client computers and Web servers are in the same domain.
    • Administrators can make sure that every client browser is Internet Explorer 2.0 or later.
    • HTTP proxy connections, which are not supported by NTLM, are not required.
    • Kerberos version 5 requires a connection to Active Directory, which is not feasible in an Internet environment.

    New in IIS 7.5

    The <extendedProtection> element was introduced in IIS 7.5, which allows you to configure the settings for the new extended protection features that have been integrated into Windows authentication.

    Compatibility

    Version Notes
    IIS 7.5 The <extendedProtection> element was added in IIS 7.5.
    IIS 7.0 The <windowsAuthentication> element was introduced in IIS 7.0.
    IIS 6.0 The <windowsAuthentication> element replaces portions of the IIS 6.0 AuthType and AuthFlags metabase properties.

    Setup

    The default installation of IIS 7 does not include the Windows authentication role service. To use Windows authentication on IIS, you must install the role service, disable Anonymous authentication for your Web site or application, and then enable Windows authentication for the site or application.

    Note: After you install the role service, IIS 7 commits the following configuration settings to the ApplicationHost.config file.

    <windowsAuthentication enabled="false" />

    Windows Server 2008 or Windows Server 2008 R2

    1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
    2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
    3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
    4. On the Select Role Services page of the Add Role Services Wizard, select Windows Authentication, and then click Next.
    5. On the Confirm Installation Selections page, click Install.
    6. On the Results page, click Close.

    Windows Vista or Windows 7

    1. On the taskbar, click Start, and then click Control Panel.
    2. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
    3. Expand Internet Information Services, then World Wide Web Services, then Security.
    4. Select Windows Authentication, and then click OK.

    How To

    How to enable Windows authentication for a Web site, Web application, or Web service

    1. Open Internet Information Services (IIS) Manager:
      • If you are using Windows Server 2008 or Windows Server 2008 R2:
        • On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
      • If you are using Windows Vista or Windows 7:
        • On the taskbar, click Start, and then click Control Panel.
        • Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
    2. In the Connections pane, expand the server name, expand Sites, and then the site, application, or Web service for which you want to enable Windows authentication.
    3. Scroll to the Security section in the Home pane, and then double-click Authentication.
    4. In the Authentication pane, select Windows Authentication, and then click Enable in the Actions pane.

    How to enable Extended Protection for Windows authentication

    1. Open Internet Information Services (IIS) Manager:
      • If you are using Windows Server 2008 or Windows Server 2008 R2:
        • On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
      • If you are using Windows Vista or Windows 7:
        • On the taskbar, click Start, and then click Control Panel.
        • Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
    2. In the Connections pane, expand the server name, expand Sites, and then the site, application, or Web service for which you want to enable Extended Protection for Windows authentication.
    3. Scroll to the Security section in the Home pane, and then double-click Authentication.
    4. In the Authentication pane, select Windows Authentication.
    5. Click Enable in the Actions pane.
    6. Click Advanced Settings in the Actions pane.
    7. When the Advanced Settings dialog box appears, select one of the following options in the Extended Protection drop-down menu:
      • Select Accept if you want to enable extended protection while providing down-level support for clients that do not support extended protection.
      • Select Required if you want to enable extended protection without providing down-level support.
    8. Click OK to close the Advanced Settings dialog box.

    Configuration

    The <windowsAuthentication> element is configurable at the site, application, or virtual directory level in the ApplicationHost.config file.

    Attributes

    Attribute Description
    authPersistNonNTLM Optional Boolean attribute.

    Specifies whether IIS automatically reauthenticates every non-NTLM (for example, Kerberos) request, even those on the same connection. False enables multiple authentications for the same connections.

    Note: A setting of true means that the client will be authenticated only once on the same connection. IIS will cache a token or ticket on the server for a TCP session that stays established.

    The default is false.
    authPersistSingleRequest Optional Boolean attribute.

    Setting this flag to true specifies that authentication persists only for a single request on a connection. IIS resets the authentication at the end of each request, and forces reauthentication on the next request of the session.

    The default value is false.
    enabled Required Boolean attribute.

    Specifies whether Windows authentication is enabled.

    The default value is false.
    useKernelMode Optional Boolean attribute.

    Specifies whether Windows authentication is done in kernel mode. True specifies that Windows authentication uses kernel mode.

    Kernel-mode authentication may improve authentication performance and prevent authentication problems with application pools that are configured to use a custom identity.

    As a best practice, do not disable this setting if you use Kerberos authentication and have a custom identity on the application pool.

    The default is true.

    Child Elements

    Element Description
    extendedProtection Optional element.

    Specifies extended protection options for Windows authentication.

    Note: This element was added in IIS 7.5.
    providers Optional element.

    Specifies security support providers used for Windows authentication.

    Configuration Sample

    The following default <windowsAuthentication> element is configured at the root ApplicationHost.config file in IIS 7.0, and disables Windows authentication by default. It also defines the two Windows authentication providers for IIS 7.0.

    <windowsAuthentication enabled="false">
       <providers>
          <add value="Negotiate" />
          <add value="NTLM" />
       </providers>
    </windowsAuthentication>

    The following example enables Windows authentication and disables Anonymous authentication for a Web site named Contoso.

    <location path="Contoso">
       <system.webServer>
          <security>
             <authentication>
                <anonymousAuthentication enabled="false" />
                <windowsAuthentication enabled="true" />
             </authentication>
          </security>
       </system.webServer>
    </location>

    Sample Code

    The following examples disable Anonymous authentication for a site named Contoso, then enable Windows authentication for the site.

    AppCmd.exe

    appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" /commit:apphost
    
    appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost

    Note: You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.

    C#

    using System;
    using System.Text;
    using Microsoft.Web.Administration;
    
    internal static class Sample {
    
       private static void Main() {
    
          using(ServerManager serverManager = new ServerManager()) { 
             Configuration config = serverManager.GetApplicationHostConfiguration();
    
             ConfigurationSection anonymousAuthenticationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "Contoso");
             anonymousAuthenticationSection["enabled"] = false;
    
             ConfigurationSection windowsAuthenticationSection = config.GetSection("system.webServer/security/authentication/windowsAuthentication", "Contoso");
             windowsAuthenticationSection["enabled"] = true;
    
             serverManager.CommitChanges();
          }
       }
    }

    VB.NET

    Imports System
    Imports System.Text
    Imports Microsoft.Web.Administration
    
    Module Sample
       Sub Main()
          Dim serverManager As ServerManager = New ServerManager
          Dim config As Configuration = serverManager.GetApplicationHostConfiguration
    
          Dim anonymousAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "Contoso")
          anonymousAuthenticationSection("enabled") = False
    
          Dim windowsAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/windowsAuthentication", "Contoso")
          windowsAuthenticationSection("enabled") = True
    
          serverManager.CommitChanges()
       End Sub
    End Module

    JavaScript

    var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
    adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
    
    var anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso");
    anonymousAuthenticationSection.Properties.Item("enabled").Value = false;
    
    var windowsAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/windowsAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso");
    windowsAuthenticationSection.Properties.Item("enabled").Value = true;
    
    adminManager.CommitChanges();

    VBScript

    Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
    adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
    
    Set anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso")
    anonymousAuthenticationSection.Properties.Item("enabled").Value = False
    
    Set windowsAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/windowsAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso")
    windowsAuthenticationSection.Properties.Item("enabled").Value = True
    
    adminManager.CommitChanges()

    posted on 2011-09-16 21:46 九寶 閱讀(645) 評論(0)  編輯  收藏 所屬分類: Win

    主站蜘蛛池模板: 日韩免费在线观看视频| 国内免费高清在线观看| 亚洲日韩中文字幕天堂不卡 | 亚洲电影免费在线观看| 午夜寂寞在线一级观看免费| 亚洲人成77777在线播放网站不卡 亚洲人成77777在线观看网 | 自拍偷自拍亚洲精品被多人伦好爽 | 亚洲人成网77777色在线播放| 一二三四在线观看免费中文在线观看| 国产不卡免费视频| 一本一道dvd在线观看免费视频| 亚洲视频.com| 国内外成人免费视频| 两个人看的www高清免费视频 | 久久国产精品成人免费| 亚洲乱码在线观看| 国产亚洲精品国产| 国产美女a做受大片免费| 久久精品无码精品免费专区| 亚洲成a人片在线不卡一二三区| 精品亚洲综合久久中文字幕| 午夜神器成在线人成在线人免费| 国产免费一区二区三区在线观看| 亚洲爆乳大丰满无码专区| 亚洲精品高清视频| 亚洲成a人片在线播放| A在线观看免费网站大全| 两个人www免费高清视频| 国产亚洲视频在线观看网址| 亚洲精品动漫在线| 亚洲乱亚洲乱妇无码麻豆| 国产精品深夜福利免费观看| 69av免费视频| 国产妇乱子伦视频免费| 久久99国产亚洲精品观看| 成人au免费视频影院| 一级毛片视频免费观看| 亚洲视频精品在线观看| 四虎影院永久免费观看| 久久精品免费观看国产| mm1313亚洲国产精品无码试看|