Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

AuthenticationManager.Unregister Method (IAuthenticationModule)

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

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

Public Shared Sub Unregister ( _
	authenticationModule As IAuthenticationModule _


Type: System.Net.IAuthenticationModule

The IAuthenticationModule to remove from the list of registered modules.


authenticationModule is Nothing.


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.

   ' 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

      ' 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. 
        domain = args(5)
      End If 
      ' Unregister the standard Basic authentication module.

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

      ' Register the custom Basic authentication module.

      ' Display registered Authorization modules.

      ' Read the specified page and display it on the console.
    End If 
  End Sub 'Main
End Class 'ClientAuthentication 

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

© 2015 Microsoft