FormsAuthenticationCredentials クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > FormsAuthenticationCredentials クラスの意味・解説 

FormsAuthenticationCredentials クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

フォーム ベース認証使用する ASP.NET アプリケーションに対してユーザー資格情報構成します

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 FormsAuthenticationCredentials
    Inherits ConfigurationElement
Dim instance As FormsAuthenticationCredentials
public sealed class FormsAuthenticationCredentials
 : ConfigurationElement
public ref class FormsAuthenticationCredentials
 sealed : public ConfigurationElement
public final class FormsAuthenticationCredentials
 extends ConfigurationElement
public final class FormsAuthenticationCredentials
 extends ConfigurationElement
解説解説

FormsAuthenticationCredentials クラス使用すると、構成ファイルauthentication セクション内の formscredentials 要素プログラムかアクセスして変更できます。この型は、FormsAuthenticationConfiguration 型、FormsAuthenticationUserCollection 型、FormsAuthenticationUser 型を含むグループ一部です。コレクション型以外はすべて、基になる構成タグ直接影響与えます

メモメモ

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

使用例使用例

この例では、credentials セクション複数属性に対して宣言によって値を指定する方法示してます。これらの属性には、FormsAuthenticationCredentials クラスメンバとしてもアクセスできます

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

<credentials passwordFormat="SHA1">
  <user name="aspnetuser1"
    password="5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"/>
  <user name="aspnetuser2"
    password="E38AD214943DAAD1D64C102FAEC29DE4AFE9DA3D"/>
</credentials>
メモメモ

credentials セクション使用する場合は、「ASP.NET認証」に説明されているガイドラインに従う必要がありますスケーラビリティセキュリティ高めるため、外部データベース使用してユーザー資格情報保管することをお勧めます。安全な ASP.NET アプリケーション構築する方法詳細については、Microsoft MSDN Web サイト (http://msdn.microsoft.com) で、「Securing Your ASP.NET Application」や「Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication」を参照してください

FormsAuthenticationCredentials クラス使用する方法次のコード例示します

' Get the Web application configuration.
  Dim configuration As System.Configuration.Configuration
 = _
  WebConfigurationManager.OpenWebConfiguration( _
  "/aspnetTest")

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

' Get the forms credentials collection .
  Dim formsAuthenticationCredentials _
  As FormsAuthenticationCredentials = _
  authenticationSection.Forms.Credentials

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

// Get the authentication section.
AuthenticationSection authenticationSection = 
    (AuthenticationSection)configuration.GetSection(
    "system.web/authentication");

// Get the forms credentials collection .
FormsAuthenticationCredentials formsAuthenticationCredentials =
    authenticationSection.Forms.Credentials;

継承階層継承階層
System.Object
   System.Configuration.ConfigurationElement
    System.Web.Configuration.FormsAuthenticationCredentials
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「FormsAuthenticationCredentials クラス」の関連用語

FormsAuthenticationCredentials クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FormsAuthenticationCredentials クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS