Export (0) Print
Expand All

PassportAuthentication Class

Configures Passport-based authentication in ASP.NET applications.

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

public sealed class PassportAuthentication : ConfigurationElement
public final class PassportAuthentication extends ConfigurationElement
public final class PassportAuthentication extends ConfigurationElement
Not applicable.

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.
// Get the Web application configuration.
System.Configuration.Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest");

// Get the section.
System.Web.Configuration.AuthenticationSection authenticationSection = (System.Web.Configuration.AuthenticationSection)configuration.GetSection("system.web/authentication");

// Get the authentication passport element.
PassportAuthentication passport = 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 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft