Passport PassportIdentity Object
Passport PassportIdentity Object
The Passport PassportIdentity object wraps the Passport Manager and Crypt objects in a C# interface. The PassportIdentity object is used by the PassportAuthenticationModule to validate a user's sign-in information before allowing access to resources, and enables you to use Microsoft® .NET Passport single sign-in (SSI) and Kids Passport services, and encrypt or decrypt information using the C# language.
To obtain a reference to a Passport PassportIdentity object, cast the User.Identity attribute. The following code performs the cast and is used in the methods and properties of this class.
PassportIdentity oMgr = (PassportIdentity)User.Identity;
PassportIdentity Constructor
PassportIdentity Initializes a new instance of the PassportIdentity class.
PassportIdentity Properties
AuthenticationType Gets the type of authentication used to identify the user. Error Gets a value indicating the error state associated with the current .NET Passport Ticket. GetFromNetworkServer Determines whether a connection is coming back from a .NET Passport server (Login, Update, or Registration) and whether the .NET Passport data contained on the query string is valid. HasSavedPassword Declares whether the user has selected the option to be signed in automatically on the .NET Passport Login page. HasTicket Gets a value indicating whether the user has a .NET Passport Ticket as a cookie or on the query string. HexPUID Gets the .NET Passport Unique ID (PUID) for the currently authenticated user, in hexadecimal form. IsAuthenticated Gets a value indicating whether the user is authenticated against a .NET Passport authority. Item Gets .NET Passport profile attributes and returns profile information for the specified profile attribute. This property is the indexer for the PassportIdentity class. Name Gets the name of the current user, which is the .NET Passport Unique ID (PUID). Ticket Gets information about a specific attribute of the .NET Passport authentication Ticket. TicketAge Gets the amount of time, in seconds, that has passed since a user's Ticket was issued or refreshed. TimeSinceSignIn Gets the time, in seconds, since a user's manual sign-in to the .NET Passport Login server.
PassportIdentity Methods
Overloaded. Returns a string containing the Login server URL for a user's domain, as well as optional information sent to the Login server in the query string.
Overloaded. Returns a string containing the Login server URL for a user's domain, as well as optional information sent to the Login server in the query string.
Given a string, compresses the string into a double-byte representation of the same string.
Determines whether the key used for encryption and decryption is valid and whether the PassportIdentity object is correctly created and configured for encryption.
Sets the key being used for .NET Passport encryption and decryption by referring to the host name or IP number being used by the desired installation.
Sets the key being used for .NET Passport encryption and decryption by referring to the site-name label assigned to that key when the key was first installed.
Decompresses data that has been compressed by the Compress method.
Decrypts data encrypted with Encrypt method, using the same key.
Encrypts data using the same participant key that is used to exchange .NET Passport information sent to the .NET Passport network.
Frees resources used by the PassportIdentity class. In C#, finalizers are expressed using destructor syntax.
Returns the contents of a registry key under the registry hive HKLM\SW\Microsoft\Passport.
Provides information for a particular .NET Passport domain by querying the Passport Manager for the requested domain attribute.
Returns the user's domain name as a string.
Overloaded. Indicates whether the user is authenticated by a .NET Passport authority.
Overloaded. Returns the URL and header information to facilitate a .NET Passport sign-in.
Gets a specific .NET Passport sign-in option.
Gets .NET Passport profile attributes and returns profile information for the specified profile attribute.
Not implemented. User Error instead.
Indicates whether a user has core profile data already in a cookie.
Returns whether a user has consent for purposes of Kids Passport authentication.
Overloaded. Logs the user on, either by generating a 302 redirect URL or by initiating a .NET Passport-aware client authentication exchange.
Overloaded. Returns an HTML fragment containing an image tag for a .NET Passport link.
Overloaded. Returns an HTML fragment containing an image tag for a .NET Passport link.
Overloaded. Returns the .NET Passport logout URL string.
Sets a specific .NET Passport sign-in option.
Signs the .NET Passport user out from the current session.
Gets information about a specific attribute of the .NET Passport authentication Ticket.
See Also