AuthenticationSection クラス

定義

Web アプリケーションの認証を構成します。 このクラスは継承できません。

public ref class AuthenticationSection sealed : System::Configuration::ConfigurationSection
public sealed class AuthenticationSection : System.Configuration.ConfigurationSection
type AuthenticationSection = class
    inherit ConfigurationSection
Public NotInheritable Class AuthenticationSection
Inherits ConfigurationSection
継承

このセクションでは、2 つのコード例を示します。 1 つ目は、 セクションのいくつかの属性に対して宣言的に値を authentication 指定する方法を示しています。これは、 クラスの AuthenticationSection メンバーとしてアクセスすることもできます。 2 つ目は、 クラスの使用方法を AuthenticationSection 示しています。

次の構成ファイルの例は、 セクションに値を宣言的に指定する方法を authentication 示しています。

Note

セクションを使用する credentials 場合は、「 ASP.NET 認証」で説明されているガイドラインに従ってください。 スケーラビリティとセキュリティを向上させるために、外部データベースを使用してユーザーの資格情報を格納することをお勧めします。

<authentication mode="Forms">
  <forms name="MyAppCookieName" loginUrl="login.aspx">
    <credentials passwordFormat="SHA1">
      <user name="Kim"
         password="07B7F3EE06F278DB966BE960E7CBBD103DF30CA6"/>
      <user name="John"
         password="BA56E5E0366D003E98EA1C7F04ABF8FCB3753889"/>
    </credentials>
  </forms>
</authentication>

この例では SHA1 を使用します。 SHA1 との競合問題のため、Microsoft では SHA256 を推奨しています。

次のコード例では、 クラスの使用方法 AuthenticationSection を示します。

// Get the Web application configuration.
System.Configuration.Configuration configuration =
    System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(
    "/aspnetTest");

// Get the section.
AuthenticationSection authenticationSection =
    (AuthenticationSection)configuration.GetSection(
    "system.web/authentication");
' Get the Web application configuration.
  Dim configuration _
  As System.Configuration.Configuration = _
  System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration( _
  "/aspnetTest")

' Get the section.
  Dim authenticationSection _
  As AuthenticationSection = _
  CType(configuration.GetSection( _
  "system.web/authentication"), AuthenticationSection)

注釈

AuthenticationSection クラスを使用すると、構成ファイルの authentication セクションにプログラムからアクセスして変更できます。

Note

AuthenticationSection、値MachineToApplicationが である section プロパティAllowDefinitionで定義されている制限に従って、構成ファイルの関連セクションに情報を書き込むことができます。 階層内で許可されていないレベルで構成ファイルに書き込もうとすると、パーサーによってエラー メッセージが生成されます。 ただし、このクラスを使用して、階層内の任意のレベルで構成情報を読み取ることができます。 安全性とスケーラビリティを確保するために、データベースなどの外部リポジトリを使用して、ユーザーの資格情報を保持することをお勧めします。

コンストラクター

AuthenticationSection()

AuthenticationSection クラスの新しいインスタンスを初期化します。

プロパティ

CurrentConfiguration

現在の Configuration インスタンスが属している構成階層を表す最上位の ConfigurationElement インスタンスへの参照を取得します。

(継承元 ConfigurationElement)
ElementInformation

ElementInformation オブジェクトのカスタマイズできない情報と機能を格納する ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
ElementProperty

ConfigurationElementProperty オブジェクト自体を表す ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
EvaluationContext

ContextInformation オブジェクトの ConfigurationElement オブジェクトを取得します。

(継承元 ConfigurationElement)
Forms

Forms 要素プロパティを取得します。

HasContext

CurrentConfiguration プロパティが null であるかどうかを示す値を取得します。

(継承元 ConfigurationElement)
Item[ConfigurationProperty]

この構成要素のプロパティまたは属性を取得または設定します。

(継承元 ConfigurationElement)
Item[String]

この構成要素のプロパティ、属性、または子要素を取得または設定します。

(継承元 ConfigurationElement)
LockAllAttributesExcept

ロックされている属性のコレクションを取得します。

(継承元 ConfigurationElement)
LockAllElementsExcept

ロックされている要素のコレクションを取得します。

(継承元 ConfigurationElement)
LockAttributes

ロックされている属性のコレクションを取得します。

(継承元 ConfigurationElement)
LockElements

ロックされている要素のコレクションを取得します。

(継承元 ConfigurationElement)
LockItem

要素がロックされているかどうかを示す値を取得または設定します。

(継承元 ConfigurationElement)
Mode

認証モードを取得または設定します。

Passport
古い.

Passport 要素プロパティを取得します。

Properties

プロパティのコレクションを取得します。

(継承元 ConfigurationElement)
SectionInformation

SectionInformation オブジェクトのカスタマイズできない情報と機能を格納する ConfigurationSection オブジェクトを取得します。

(継承元 ConfigurationSection)

メソッド

DeserializeElement(XmlReader, Boolean)

構成ファイルから XML を読み取ります。

(継承元 ConfigurationElement)
DeserializeSection(XmlReader)

構成ファイルから XML を読み取ります。

(継承元 ConfigurationSection)
Equals(Object)

現在の ConfigurationElement インスタンスを、指定したオブジェクトと比較します。

(継承元 ConfigurationElement)
GetHashCode()

現在の ConfigurationElement インスタンスを表す一意の値を取得します。

(継承元 ConfigurationElement)
GetRuntimeObject()

派生クラスでオーバーライドされると、カスタム オブジェクトを返します。

(継承元 ConfigurationSection)
GetTransformedAssemblyString(String)

指定されたアセンブリ名を変換して返します。

(継承元 ConfigurationElement)
GetTransformedTypeString(String)

指定された型名を変換して返します。

(継承元 ConfigurationElement)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
Init()

ConfigurationElement オブジェクトを初期状態に設定します。

(継承元 ConfigurationElement)
InitializeDefault()

ConfigurationElement オブジェクトの既定の値セットを初期化するために使用します。

(継承元 ConfigurationElement)
IsModified()

派生クラスに実装された場合、この構成要素が最後の保存または読み込み以降に変更されたかどうかを示します。

(継承元 ConfigurationSection)
IsReadOnly()

ConfigurationElement オブジェクトが読み取り専用かどうかを示す値を取得します。

(継承元 ConfigurationElement)
ListErrors(IList)

この ConfigurationElement オブジェクトおよびすべてのサブ要素の無効なプロパティのエラーを、渡されたリストに追加します。

(継承元 ConfigurationElement)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnDeserializeUnrecognizedAttribute(String, String)

逆シリカル化中に不明な属性が発生したかどうかを示す値を取得します。

(継承元 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

逆シリカル化中に不明な要素が発生したかどうかを示す値を取得します。

(継承元 ConfigurationElement)
OnRequiredPropertyNotFound(String)

必要なプロパティが見つからないと例外がスローされます。

(継承元 ConfigurationElement)
PostDeserialize()

逆シリアル化後に呼び出されます。

(継承元 ConfigurationElement)
PreSerialize(XmlWriter)

シリアル化前に呼び出されます。

(継承元 ConfigurationElement)
Reset(ConfigurationElement)

ConfigurationElement オブジェクトの内部状態 (ロックやプロパティ コレクションなど) をリセットします。

(継承元 ConfigurationElement)
ResetModified()

IsModified() メソッドの値が派生クラスに実装されたときに、false にリセットします。

(継承元 ConfigurationSection)
SerializeElement(XmlWriter, Boolean)

派生クラスに実装されている場合、この構成要素の内容を構成ファイルに書き込みます。

(継承元 ConfigurationElement)
SerializeSection(ConfigurationElement, String, ConfigurationSaveMode)

ファイルに書き込む 1 つのセクションとして、ConfigurationSection オブジェクトのアンマージされたビューを含む XML 文字列を作成します。

(継承元 ConfigurationSection)
SerializeToXmlElement(XmlWriter, String)

派生クラスに実装されている場合、この構成要素の外側のタグを構成ファイルに書き込みます。

(継承元 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

プロパティを指定した値に設定します。

(継承元 ConfigurationElement)
SetReadOnly()

IsReadOnly() オブジェクトおよびすべてのサブ要素に ConfigurationElement プロパティを設定します。

(継承元 ConfigurationElement)
ShouldSerializeElementInTargetVersion(ConfigurationElement, String, FrameworkName)

指定したターゲット バージョンの.NET Frameworkに対して構成オブジェクト階層をシリアル化するときに、指定した要素をシリアル化する必要があるかどうかを示します。

(継承元 ConfigurationSection)
ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement)

指定したターゲット バージョンの.NET Frameworkの構成オブジェクト階層をシリアル化するときに、指定したプロパティをシリアル化するかどうかを示します。

(継承元 ConfigurationSection)
ShouldSerializeSectionInTargetVersion(FrameworkName)

指定したターゲット バージョンの.NET Frameworkの構成オブジェクト階層をシリアル化するときに、現在ConfigurationSectionのインスタンスをシリアル化する必要があるかどうかを示します。

(継承元 ConfigurationSection)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

保存しないすべての値を削除するには、ConfigurationElement オブジェクトを変更します。

(継承元 ConfigurationElement)

適用対象

こちらもご覧ください