Share via


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

AuthUrl

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.

AuthUrl2

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.

Compress

Given a string, compresses the string into a double-byte representation of the same string.

CryptIsValid

Determines whether the key used for encryption and decryption is valid and whether the PassportIdentity object is correctly created and configured for encryption.

CryptPutHost

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.

CryptPutSite

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.

Decompress

Decompresses data that has been compressed by the Compress method.

Decrypt

Decrypts data encrypted with Encrypt method, using the same key.

Encrypt

Encrypts data using the same participant key that is used to exchange .NET Passport information sent to the .NET Passport network.

Finalize

Frees resources used by the PassportIdentity class. In C#, finalizers are expressed using destructor syntax.

GetCurrentConfig

Returns the contents of a registry key under the registry hive HKLM\SW\Microsoft\Passport.

GetDomainAttribute

Provides information for a particular .NET Passport domain by querying the Passport Manager for the requested domain attribute.

GetDomainFromMemberName

Returns the user's domain name as a string.

GetIsAuthenticated

Overloaded. Indicates whether the user is authenticated by a .NET Passport authority.

GetLoginChallenge

Overloaded. Returns the URL and header information to facilitate a .NET Passport sign-in.

GetOption

Gets a specific .NET Passport sign-in option.

GetProfileObject

Gets .NET Passport profile attributes and returns profile information for the specified profile attribute.

HasFlag

Not implemented. User Error instead.

HasProfile

Indicates whether a user has core profile data already in a cookie.

HaveConsent

Returns whether a user has consent for purposes of Kids Passport authentication.

LoginUser

Overloaded. Logs the user on, either by generating a 302 redirect URL or by initiating a .NET Passport-aware client authentication exchange.

LogoTag

Overloaded. Returns an HTML fragment containing an image tag for a .NET Passport link.

LogoTag2

Overloaded. Returns an HTML fragment containing an image tag for a .NET Passport link.

LogoutURL

Overloaded. Returns the .NET Passport logout URL string.

SetOption

Sets a specific .NET Passport sign-in option.

SignOut

Signs the .NET Passport user out from the current session.

Ticket

Gets information about a specific attribute of the .NET Passport authentication Ticket.

See Also

Configuring Multiple Sites