AuthenticationManager.Register メソッドとは? わかりやすく解説

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

AuthenticationManager.Register メソッド

認証マネージャ認証モジュール登録します

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

Public Shared Sub Register
 ( _
    authenticationModule As IAuthenticationModule _
)
Dim authenticationModule As IAuthenticationModule

AuthenticationManager.Register(authenticationModule)
public static void Register
 (
    IAuthenticationModule authenticationModule
)
public:
static void Register (
    IAuthenticationModule^ authenticationModule
)
public static void Register
 (
    IAuthenticationModule authenticationModule
)
public static function Register
 (
    authenticationModule : IAuthenticationModule
)

パラメータ

authenticationModule

認証マネージャ登録する IAuthenticationModule。

例外例外
例外種類条件

ArgumentNullException

authenticationModulenull 参照 (Visual Basic では Nothing) です。

解説解説

Register メソッドは、Authenticate メソッドによって呼び出されるモジュールの一覧の末尾に、認証モジュール追加します認証モジュールは、一覧に追加した順序呼び出されます。同じ AuthenticationType を持つモジュールが既に登録されている場合、このメソッド登録されているモジュール削除して、一覧の最後に authenticationModule追加します

使用例使用例

認証マネージャ認証モジュール登録する例を次に示します詳細については、AuthenticationManager クラストピック参照してください

 ' This is the program entry point. It allows the user to enter 
 ' her credentials and the Internet resource (Web page) to access.
 ' It also unregisters the standard and registers the customized basic
 
 ' authentication.
Private Overloads Shared
 Sub Main(ByVal args() As
 String)

  If args.Length < 4 Then
    showusage()
  Else

    ' Read the user's credentials.
    uri = args(1)
    username = args(2)
    password = args(3)

    If args.Length = 4 Then
      domain = String.Empty
      ' If the domain exists, store it. Usually the domain name
      ' is by default the name of the server hosting the Internet
      ' resource.
    Else
      domain = args(5)
    End If
    ' Unregister the standard Basic authentication module.
    AuthenticationManager.Unregister("Basic")

    ' Instantiate the custom Basic authentication module.
    Dim customBasicModule As New
 CustomBasic()

    ' Register the custom Basic authentication module.
    AuthenticationManager.Register(customBasicModule)

    ' Display registered Authorization modules.
    displayRegisteredModules()

    ' Read the specified page and display it on the console.
    getPage(uri)
  End If
  Return
End Sub 'Main
// This is the program entry point. It allows the user to enter 
// her credentials and the Internet resource (Web page) to access.
// It also unregisters the standard and registers the customized basic
 
// authentication.
public static void Main(string[]
 args) 
{

  if (args.Length < 3)
    showusage();
  else 
  {    
     
    // Read the user's credentials.
    uri = args[0];
    username = args[1];
    password = args[2];

    if (args.Length == 3)
      domain = string.Empty;
    else
      // If the domain exists, store it. Usually the domain name
      // is by default the name of the server hosting the Internet
      // resource.
      domain = args[3];

    // Unregister the standard Basic authentication module.
    AuthenticationManager.Unregister("Basic");

    // Instantiate the custom Basic authentication module.
    CustomBasic customBasicModule = new CustomBasic();
       
    // Register the custom Basic authentication module.
    AuthenticationManager.Register(customBasicModule);
 
    // Display registered Authorization modules.
    displayRegisteredModules();
    
    // Read the specified page and display it on the console.
    getPage(uri);
  }
  return;
}
// This is the program entry point. It allows the user to enter 
// her credentials and the Internet resource (Web page) to access.
// It also unregisters the standard and registers the customized basic
 
// authentication.
static void Main()
{
   array<String^>^args = Environment::GetCommandLineArgs();
   if ( args->Length < 4 )
         showusage();
   else
   {
      
      // Read the user's credentials.
      uri = args[ 1 ];
      username = args[ 2 ];
      password = args[ 3 ];
      if ( args->Length == 4 )
               domain = String::Empty; // If the domain exists, store
 it. Usually the domain name
      else
               domain = args[ 4 ];

      
      // is by default the name of the server hosting the Internet
      // resource.
      // Unregister the standard Basic authentication module.
      AuthenticationManager::Unregister( "Basic" );
      
      // Instantiate the custom Basic authentication module.
      CustomBasic^ customBasicModule = gcnew CustomBasic;
      
      // Register the custom Basic authentication module.
      AuthenticationManager::Register( customBasicModule );
      
      // Display registered Authorization modules.
      displayRegisteredModules();
      
      // Read the specified page and display it on the console.
      getPage( uri );
   }

   return;
}

// This is the program entry point. It allows the user to enter 
// her credentials and the Internet resource (Web page) to access.
// It also unregisters the standard and registers the customized basic
 
// authentication.
public static void main(String[]
 args)
{
    if (args.length < 3) {
        Showusage();
    }
    else {
        // Read the user's credentials.
        uri = args[0];
        username = args[1];
        password = args[2];
        if (args.length == 3) {
            domain = "";
        }                
        else {
            // If the domain exists, store it. Usually the domain name
            // is by default the name of the server hosting the Internet
            // resource.
            domain = args[3];
        }

        // Unregister the standard Basic authentication module.
        AuthenticationManager.Unregister("Basic");

        // Instantiate the custom Basic authentication module.
        CustomBasic customBasicModule = new CustomBasic();

        // Register the custom Basic authentication module.
        AuthenticationManager.Register(customBasicModule);

        // Display registered Authorization modules.
        DisplayRegisteredModules();

        // Read the specified page and display it on the console.
        GetPage(uri);
    }
    return;
} //main
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
AuthenticationManager クラス
AuthenticationManager メンバ
System.Net 名前空間



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

辞書ショートカット

すべての辞書の索引

「AuthenticationManager.Register メソッド」の関連用語

AuthenticationManager.Register メソッドのお隣キーワード
検索ランキング

   

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



AuthenticationManager.Register メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS