membership の providers 要素 (ASP.NET 設定スキーマ)

[このドキュメントはプレビューのみを目的としており、以降のリリースで変更される可能性があります。プレースホルダーとして空白のトピックが含まれています。]

ASP.NET メンバーシップのメンバーシップ プロバイダーのコレクションを定義します。

この要素は、.NET Framework Version 2.0 で追加されました。

<providers>
    <add.../>
    <remove.../>
    <clear/>
</providers>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

要素

Description

add

メンバーシップ プロバイダーのコレクションにメンバーシップ プロバイダーのインスタンスを追加します。

clear

メンバーシップ プロバイダーのコレクションからメンバーシップ プロバイダーのすべてのインスタンスを削除します。

remove

メンバーシップ プロバイダーのコレクションからメンバーシップ プロバイダーのインスタンスを削除します。

親要素

要素

Description

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルで必要なルート要素を指定します。

system.web

ASP.NET 構成セクションのルート要素を指定します。

membership

ASP.NET メンバーシップが使用できるようにアプリケーションを構成します。

解説

アプリケーション コード内の membership 要素の構成値のアクセスおよび変更方法については、MembershipSection クラスを参照してください。

既定の構成

次の既定の providers 要素は、.NET Framework Version 2.0 において Machine.config ファイルで構成されています。

      <providers>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
      <providers> 

Framework40 に passwordCompatMode の属性を設定すると.NET 4.0 で追加されたハッシュおよび暗号化のメンバーシップ オプションを使用できます。 ただしpasswordCompatMode の属性は .NET 2.0 のハッシュだけ Framework20および暗号化のメンバーシップ オプションに設定されている場合は.NET 3.5 および .NET 3.5 SP1 で使用できます。 属性の既定値は Framework20 です。 詳細については、「MembershipPasswordCompatibilityMode」を参照してください。

使用例

ユーザー アカウント情報の格納と取得に SqlMembershipProvider プロバイダーを使用するよう ASP.NET アプリケーションを構成する方法を、次のコード例に示します。

<configuration>
    <connectionStrings>
        <add name="SqlServices" 
             connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
    </connectionStrings>
    <system.web>
        <membership 
             defaultProvider="SqlProvider"
             userIsOnlineTimeWindow="20">
             <providers>
                <remove name="AspNetSqlProvider" />
                <add name="SqlProvider"
                    type="System.Web.Security.SqlMembershipProvider"
                    connectionStringName="SqlServices"
                    enablePasswordRetrieval="false"
                    enablePasswordReset="true"
                    requiresQuestionAndAnswer="true"
                    passwordFormat="Hashed"
                    applicationName="/" />
            </providers>
        </membership>
    </system.web>
</configuration>

要素情報

構成セクション ハンドラー

System.Web.Configuration.MembershipSection

構成メンバー

MembershipSection.Providers

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

要件

Microsoft Internet Information Services (IIS) バージョン 5.0、5.1、または 6.0

.NET Framework Version 2.0

Microsoft Visual Studio 2005

参照

処理手順

How to: Lock ASP.NET Configuration Settings

Reference

membership 要素 (ASP.NET 設定スキーマ)

system.web 要素 (ASP.NET 設定スキーマ)

<configuration> 要素

membership の providers の add 要素 (ASP.NET 設定スキーマ)

membership の providers の remove 要素 (ASP.NET 設定スキーマ)

membership の providers の clear 要素 (ASP.NET 設定スキーマ)

System.Configuration

System.Web.Configuration

概念

ASP.NET Configuration Overview

ASP.NET Server Controls and Browser Capabilities

Securing Configuration

Configuration Inheritance

その他の技術情報

Managing Users Using ASP.NET Membership

ASP.NET Configuration Files

ASP.NET 構成設定

全般構成設定 (ASP.NET)

ASP.NET Configuration API