O'Reilly logo

ASP.NET in a Nutshell by Matthew MacDonald, G. Andrew Duthie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

PassportIdentity

Synopsis

This class wraps information from the Passport user profile. For example, you can retrieve the 64-bit Passport User ID (PUID) from the Name property, along with information about how long the user has been signed in (TimeSinceSignIn), how old the current ticket is (TicketAge), and whether the password is currently saved on the user’s Passport login page (HasSavedPassword). Additionally, you can get information about any error associated with the current ticket (Error), although you must compare the number to values in the Passport documentation, as no enumeration is currently supplied. Other information from the Passport profile (including everything from the user’s birth date to the user’s language preference) is available through the Item key/value collection. For information on valid attribute names, consult the Passport documentation.

The PassportIdentity class also provides several methods, many of which are shared and available without a PassportIdentity instance (such as those used for encryption and compression). You can use LoginUser() to redirect a user to the Passport sign-in page, initiate a Passport-aware client authentication exchange. You can also use SignOut() to end the user’s session.

Note that you can pass -1 to any Passport method in place of an optional integer parameter. This indicates that Passport should use the default value from the registry and is equivalent to omitting optional parameters.

Public NotInheritable Class 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required