Flags

Flags

The Flags attribute of the core profile stores system-supplied flags that indicate characteristics and options about the user's profile.

Description

The Flags attribute attaches information to the profile without forcing a schema update. The Flags attribute might be used by network servers to document special conditions about a particular profile. Although typed as a Long in the schema, this attribute should be thought of as a bitwise collection of 32 possible flags. Flags that are most useful to an affiliate site are the 1 position (e-mail validation state) and the 6 and 7 position (consent level for Microsoft Kids Passport). The Flags attribute is read-only (except when data comes from Nexus). The default value is 0, set at registration time.

Validation

The following flags are defined.

Bit Position Bit # Description
00000000 00000000 00000000 0000000* 1
0x00000001
If set, the preferred e-mail address has been verified.
00000000 00000000 00000000 000000*0 2
0x00000002
If set, the MSN® Hotmail e-mail account has been activated.
00000000 00000000 00000000 00000*00 3
0x00000004
If set, indicates the password has been recovered at the Hotmail domain.
00000000 00000000 00000000 0000*000 4
0x00000008
No longer used.
00000000 00000000 00000000 000*0000 5
0x00000010
If set, indicates the user is blocked by the Hotmail domain. The user can still authenticate.
00000000 00000000 00000000 0**00000 7 & 6 These flags reflect the consent provided to an affiliate regarding the affiliate's ability to collect and share data beyond the core profile. Affiliate Consent Status:

These two bits are combined and interpreted as an integer to indicate consent status for the affiliate.

  • 0: No Consent. - 0x00000000
  • 1: Limited Consent. The affiliate has been granted consent to collect data, but it cannot be shared with third parties. - 0x00000020
  • 2: Full Consent. The affiliate can collect and share data with third parties. - 0x00000040
00000000 00000000 0000000* *0000000 9 & 8 Account Type: These two bits are combined and interpreted to indicate the account type:
  • 0: .NET Passport - 0x00000000
  • 1: Kids Passport - 0x00000080
  • 2: Parent's .NET Passport - 0x00000100
  • 3: Reserved for future use - 0x00000180
00000000 00000000 000000*0 00000000 10
0x00000200
If set, indicates the .NET Passport username is an e-mail address, not one provided by hotmail.com or passport.com.
00000000 00000000 00000*00 00000000 11
0x00000400
If set, indicates that the MemberName as an e-mail address has been validated.
00000000 00000000 0000*000 00000000 12
0x00000800
If set, indicates the .NET Passport is associated with an Microsoft Network Internet Access (MSNIA) ISP account.
00000000 00000000 000*0000 00000000 13
0x00001000
If set, indicates the .NET Passport is associated with mobile services.
00000000 00000000 00*00000 00000000 14
0x00002000
If set, indicates this is a premium Hotmail account.
*0000000 00000000 00000000 00000000 32
0x80000000
If set, indicates that the Profile cookie will be set in the site's tertiary domain.

Example

The following Microsoft Visual Basic Scripting Edition (VBScript) example displays the value of the Flags attribute. The flags are displayed as an integer, converted to a hexadecimal value, and then converted to a binary mask for easy interpretation.

'Create a Passport Object
Set oMgr = Server.CreateObject("Passport.Manager")
Dim iflags
Dim sHexflags
Dim sHex
Dim counter
Dim sBinFlags

'Get the integer value of flags.
iflags = oMgr.Profile("flags")
Response.Write("<br>flags (int) = " & iflags)
'Convert the flags to a hexadecimal value.
sHexflags = Hex(iflags)
Response.Write("<br>flags (hex) = " & sHexflags)
'Convert the hexadecimal value to a bitmask.
for counter = 1 to len (sHexflags)
 Select Case Mid(sHexflags,counter,1)
  Case "0"
   sHex = "0000"
  Case "1"
   sHex = "0001"
  Case "2"
   sHex = "0010"
  Case "3"
   sHex = "0011"
  .
  .
  .
  Case "E"
   sHex = "1110"
  Case "F"
   sHex = "1111"
 End Select
 sBinFlags = sBinFlags + sHex & " " 
next
Response.Write("<br>flags (binary - mask) = " & sBinFlags)

The following C# example displays the value of the Flags attribute. The flags are displayed as an integer, converted to a hexadecimal value, and then converted to a binary mask for easy interpretation.

PassportIdentity oMgr;
int iflags;
string sHexflags;
string sHex = null;
int counter;
string sBinFlags = null;
oMgr = (PassportIdentity)User.Identity;
//Get the integer value of flags.
iflags = Convert.ToInt32(oMgr.GetProfileObject("flags"));
Response.Write ("<br>flags (int)= " + iflags.ToString());
//Get the hexadecimal value of flags.
sHexflags = Convert.ToString(Convert.ToInt32(oMgr.GetProfileObject("flags")),16);
Response.Write ("<br>flags (hex)= " + sHexflags);
//Convert the hexadecimal value to a bitmask.
for (counter = 0; counter < sHexflags.Length; counter++){
    switch (sHexflags.Substring(counter,1))
    {
    case "0":
        sHex = "0000";
        break;
    case "1":
        sHex = "0001";
        break;
    case "2":
        sHex = "0010";
        break;
    case "3":
        sHex = "0011";
        break;
.
.
.
    case "F":
        sHex = "1111";
        break;
    } //end switch
    sBinFlags = sBinFlags + sHex + " ";
}// next value in sHexflags
Response.Write ("<br> flags (binary - mask) = " + sBinFlags);

See Also

.NET Passport Profile Schema | Core Profile Table | Manager.Profile