Compartir a través de


Problems Accessing and Saving User Profile Data

Problems Accessing and Saving User Profile Data

If your site is experiencing difficulty with accessing or modifying Microsoft .NET Passport user profile data, consult the following sections. If you still have not solved your problem, see Advanced Troubleshooting.

My attempts to access user core profile attributes return either empty values or unexpected results.

There are several reasons why an attempt to retrieve an attribute of a user's core profile may return an empty string.

If the field attribute exists but the data is missing or not specified for that user, or if the user did not consent to share personal information, or that user does not have a current Ticket or is not signed in, an empty string is returned. Any non-string attribute that returns an empty value will return a variant of type VT_EMPTY rather than a zero or a missing value. In Microsoft® Visual Basic® Scripting Edition (VBScript), the IsEmpty function will return True for that attribute. For a string attribute, an empty value will return a zero-length string, but IsEmpty will actually return False.

  • Is your site in test mode?

    Test mode sites do not have access to full user core profile data, so some attributes return default values rather than the actual attribute values. For more information, see Test Mode.

  • Have you fully completed the registration process, including installation of your site's encryption key and Site ID?

    For access to user core profile data, your Site ID, as set in the Passport Manager Administration utility, must match the Site ID that you were provided with when you registered your site. If it does not, the Profile (and Ticket) cookies cannot be read or even written.

  • Does your site's code check to make sure that the current .NET Passport user has a core profile using the HasProfile method of the Passport Manager object?

    This is a good practice before you attempt to access any specific profile item.

  • Does your code first check to make sure that non-empty data exists for that attribute in the .NET Passport user's core profile before attempting to read it?

    Another good practice is to check whether the string length is greater than zero.

    Only MemberIDHigh, MemberIDLow, BDay_Precision, ProfileVersion are guaranteed to contain non-null, non-empty, useful values. Attributes such as Nickname can be blank because that user does not choose to share a nickname in his or her core profile. Very few attributes of a .NET Passport profile are always guaranteed to contain data. For more information, see .NET Passport Profile.

  • Is your code attempting to access an attribute using the correct attribute name?

    Incorrectly referenced attribute names may result in a run-time error when either reading or writing a profile.

  • Does your code verify that the user has a current Ticket and is signed in?

    To be sure, always call HasProfile, which returns True only if the Profile cookie exists for this user.

  • Is your site using Kids Passport?

    Profiles for users who are subject to consent are not given if the user does not have consent at the .NET Passport domain authority. For more information, see Kids Passport Overview.

An attempt to access a specific user core profile attribute displays an ASP script error.

If you attempt to retrieve a value for a field attribute that does not exist in the core profile table, a "No such attribute" Active Server Pages (ASP) script error will result.

Attributes will never be removed from the core profile, but they may be added by making a change and then distributing updated Component Configuration Document (CCD) files to each participating site using built-in update capabilities of the Passport Manager object. Calling such a new attribute would result in this same scripting error if the CCD was not properly updated. For tips on debugging CCD refresh failures and Microsoft® Windows NT® events related to .NET Passport, see Troubleshooting: Windows NT Events.

Also make sure that the attribute you are using is of the expected type or can be coerced into the expected type. For a reference that gives data types of .NET Passport profile attributes, see the Core Profile Table.

Users edit their .NET Passport core profile data on my site, but the changes are not saved.

The only supported method for updating users' profile information is through Edit Profile on .NET Passport Member Services. To do this, your site must link to Edit Profile using the GetDomainAttribute("EditProfile") method with your Site ID and return URL. However, data will be shared only as specified by the user's Data Consent options.

Security and Privacy Reminders

You must make all efforts to keep .NET Passport user core profile data as protected and restricted as possible. Review the following items to make sure that your site is following all .NET Passport policies and standards:

  • Have you read, understood, and signed the comprehensive Microsoft privacy statement?
  • Do you have a posted privacy statement?
  • All United States-based sites should be registered with an independent, industry-recognized, privacy organization, such as TRUSTe or BBBOnLine.
  • Is your site constructed in such a way that all of Microsoft's privacy and security policies are being followed?
  • Are pages of your site that access .NET Passport user profile data using the POST method rather than the GET method to transfer user profile data to other pages? This is especially important when transferring the data between a collecting form and the page that performs the upload using the Profile property and the Commit and LogoTag2 methods.

See Also

Core Profile Schema