This documentation is archived and is not being maintained.

PassportAuthentication Class

Configures Passport-based authentication in ASP.NET applications.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

'Declaration
Public NotInheritable Class PassportAuthentication _
	Inherits ConfigurationElement
'Usage
Dim instance As PassportAuthentication

The PassportAuthentication class allows you to access and configure a node in the Machine.config or Web.config configuration file identified by the passport tag.

This type is part of a group that includes the AuthenticationSection, FormsAuthenticationConfiguration, and AuthenticationMode types.

NoteNote:

The PassportAuthentication class can write information into the related section of the configuration file at machine, site, or application level only. Any attempt to write in a configuration file at a different level in the hierarchy will result in an error message generated by the parser. You can use this class to read configuration information at any level in the hierarchy.

The following code example shows how to obtain the PassportAuthentication object from the configuration file of an existing Web application. Also shown is a configuration example.

<authentication>
  <passport redirectUrl="Login.aspx"/>
</authentication>
' Get the configuration. 
Dim configuration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest")

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

' Get the authentication passport element. 
Dim passport As PassportAuthentication = authenticationSection.Passport

System.Object
  System.Configuration.ConfigurationElement
    System.Web.Configuration.PassportAuthentication

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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

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
Show: