This documentation is archived and is not being maintained.

AuthenticationManager.Unregister Method (IAuthenticationModule)

Removes the specified authentication module from the list of registered modules.

Namespace:  System.Net
Assembly:  System (in System.dll)

public static function Unregister(
	authenticationModule : IAuthenticationModule


Type: System.Net.IAuthenticationModule

The IAuthenticationModule to remove from the list of registered modules.


authenticationModule is a null reference (Nothing in Visual Basic).


The specified IAuthenticationModule is not registered.

The Unregister method removes the specified authentication module from the list of authentication modules called by the Authenticate method. The module must have been added to the list using the Register method before it can be removed from the list.

The following example uses the Unregister method to remove the specified authentication module from the list of registered modules. For a complete example, refer to the AuthenticationManager class.

No code example is currently available or this language may not be supported.
    // 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() 
        String* args[] = Environment::GetCommandLineArgs();

        if (args->Length < 4)

            // 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
                // is by default the name of the server hosting the Internet
                // resource.
                domain = args[4];

            // Unregister the standard Basic authentication module.

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

            // Register the custom Basic authentication module.

            // Display registered Authorization modules.

            // Read the specified page and display it on the console.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0