This documentation is archived and is not being maintained.

AuthenticationManager.RegisteredModules Property

Gets a list of authentication modules that are registered with the authentication manager.

[Visual Basic]
Public Shared ReadOnly Property RegisteredModules As IEnumerator
[C#]
public static IEnumerator RegisteredModules {get;}
[C++]
public: __property static IEnumerator* get_RegisteredModules();
[JScript]
public static function get RegisteredModules() : IEnumerator;

Property Value

An IEnumerator that enables the registered authentication modules to be read.

Remarks

The RegisteredModules property provides an IEnumerator instance that enables the list of registered authentication modules to be read. The Register method adds modules to the list, and the Unregister method removes modules from it.

Example

[Visual Basic, C#, C++] The following example uses the RegisteredModules property to get a list of authentication modules that are registered with the authentication manager. For a complete example, refer to the AuthenticationManager class.

[Visual Basic] 
' Display registered authentication modules.
Private Shared Sub displayRegisteredModules()
  ' The AuthenticationManager calls all authentication modules sequentially 
  ' until one of them responds with an authorization instance.  Show
  ' the current registered modules.
  Dim registeredModules As IEnumerator = AuthenticationManager.RegisteredModules
  Console.WriteLine(ControlChars.Cr + ControlChars.Lf + "The following authentication modules are now registered with the system:")
  While registeredModules.MoveNext()
    Console.WriteLine(ControlChars.Cr + " " + ControlChars.Lf + " Module : {0}", registeredModules.Current)
    Dim currentAuthenticationModule As IAuthenticationModule = CType(registeredModules.Current, IAuthenticationModule)
    Console.WriteLine(ControlChars.Tab + "  CanPreAuthenticate : {0}", currentAuthenticationModule.CanPreAuthenticate)
  End While
End Sub 'displayRegisteredModules 


[C#] 
// Display registered authentication modules.
private static void displayRegisteredModules() 
{
  // The AuthenticationManager calls all authentication modules sequentially 
  // until one of them responds with an authorization instance.  Show
  // the current registered modules.
  IEnumerator registeredModules = AuthenticationManager.RegisteredModules; 
  Console.WriteLine("\r\nThe following authentication modules are now registered with the system:");
  while(registeredModules.MoveNext())
  {
    Console.WriteLine("\r \n Module : {0}",registeredModules.Current); 
    IAuthenticationModule currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current;
    Console.WriteLine("\t  CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate); 
  }      
}

[C++] 
// Display registered authentication modules.
static void displayRegisteredModules() {
   // The AuthenticationManager calls all authentication modules sequentially
   // until one of them responds with an authorization instance.  Show
   // the current registered modules, for testing purposes.
   IEnumerator* registeredModules = AuthenticationManager::RegisteredModules;
   Console::WriteLine(S"\r\nThe following authentication modules are now registered with the system");
   while(registeredModules->MoveNext()) {
      Console::WriteLine(S"\r \n Module : {0}",
         registeredModules->Current);
      IAuthenticationModule* currentAuthenticationModule =
         dynamic_cast<IAuthenticationModule*>(registeredModules->Current);
      Console::WriteLine(S"\t  CanPreAuthenticate : {0}", 
         __box(currentAuthenticationModule->CanPreAuthenticate));
   }
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

AuthenticationManager Class | AuthenticationManager Members | System.Net Namespace

Show: