PassportIdentity.Ticket
PassportIdentity.Ticket
Gets information on a specific attribute of the Microsoft® .NET Passport authentication Ticket.
Syntax
public object Ticket( string strAttribute )
Parameters
- strAttribute
A string identifying the .NET Passport authentication Ticket to return.
Return values
An object representing an attribute of the .NET Passport authentication Ticket.
Example
The following C# example uses the Ticket method to retrieve four different attributes associated with the Ticket.
<%@ Page Language="C#"%> <HTML> <HEAD><TITLE>Mysample - Exercise - CS</TITLE></HEAD> <Script language="C#" runat="server"> PassportIdentity oMgr; string sMembername; string strDomain; protected void Page_Load(Object src, EventArgs e) { oMgr = (PassportIdentity)User.Identity; } </Script> <% if (oMgr.GetIsAuthenticated(3600,false,false)) { //You are authenticated, get the requested information Response.Write("<br>Ticket('DA-Skew') = " + oMgr.Ticket("DA-Skew")); Response.Write("<br>Ticket('CredInfo') = " + oMgr.Ticket("CredInfo")); Response.Write("<br>Ticket('PinTime') = " + oMgr.Ticket("PinTime")); Response.Write("<br>Ticket('PassportFlags') = " + oMgr.Ticket("PassportFlags")); } else { Response.Write ("You have not been authenticated within the last hour. Please exit."); } // End if GetIsAuthenticated %></HTML>
Remarks
A Ticket is a cookie used for .NET Passport single sign-in (SSI) and profile sharing. This method provides a means for participating sites to query a Ticket for specific attributes.
Valid attribute names are determined by the schema sent to participating sites in the Partner.xml Component Configuration Document (CCD). Asking for a strAttribute that does not exist will give a run-time error. The following is a list of valid attributes.
strAttribute Description DA-Skew Domain authority time difference (the time difference between the participating site and the .NET Passport authentication site). This difference is used to determine the age of the Ticket. CredInfo Security level and credential type. Credential type is not currently used. PassportFlags Any flags set by .NET Passport for the login. PinTime If the security level is other than 100, this value is 0. If the security level is set to 100, this value indicates the time since the user has signed in with the PIN. The following PassportFlags are defined.
Bit Position Bit #/value Description 00000000 00000000 00000000 0000000* 1
0x00000001Using None Public Computer. If set, the user is not using a public computer. 00000000 00000000 00000000 000000*0 2
0x00000002If set, the user has checked the Has Saved Password check box on the Credential sign-in. 00000000 00000000 00000000 000000** 1 & 2
0x00000003Interpretation of Bits #1 and #2. If both bits are set, persists the cookie. 00000000 00000000 00000000 00*00000 6
0x00000020Limited consent for purposes of Microsoft® Kids Passport. The affiliate has been granted consent to collect data, but it cannot be shared with third parties. 00000000 00000000 00000000 0*000000 7
0x00000040Full consent for the purposes of Kids Passport. The affiliate can collect and share data with third parties. 00000000 00000000 00000000 0**00000 6 & 7
0x00000060Interpretation of Bits #6 and #7. Kids Passport consent status. 00000000 00000000 00000000 *0000000 8
0x00000080Account Type. Kids Passport. 00000000 00000000 0000000* 00000000 9
0x00000100Account Type. Parent's .NET Passport linked to child's. 00000000 00000000 0000000* *0000000 8 & 9
0x00000180Account Type. Interpretation of Bits #8 and #9. 00000000 00000000 000*0000 00000000 13
0x00010000E-mail grace. 00000000 00000000 00*00000 00000000 14
0x00020000E-mail warning. 00000000 00000000 00**0000 00000000 15
0x00030000E-mail blocked.
See Also