UserIdentity UserIdentity UserIdentity UserIdentity UserIdentity Class

Definition

Contains the ID, tickets, and other information associated with a user.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

public : sealed class UserIdentity : IUserIdentity
struct winrt::Windows::Security::Authentication::OnlineId::UserIdentity : IUserIdentity
public sealed class UserIdentity : IUserIdentity
Public NotInheritable Class UserIdentity Implements IUserIdentity
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

List<OnlineIdServiceTicketRequest> targetArray = new List<OnlineIdServiceTicketRequest>();
targetArray.Add(new OnlineIdServiceTicketRequest("wl.basic wl.contacts_photos wl.calendars",
        "DELEGATION"));

DebugPrint("Signing in ...");

Windows.Security.Authentication.OnlineId.UserIdentity result = 
        await _authenticator.AuthenticateUserAsync(targetArray, CredentialPromptType.PromptIfNeeded);

if (result.Tickets[0].Value != string.Empty)
{
    DebugPrint("Signed in.");
    IsNotSignedIn = false;
}
else
{
    // Handle errors like bad parameter, misconfigured target, and so on.
    DebugPrint("Unable to get the ticket. Error: " + result.Tickets[0].ErrorCode.ToString());
    IsNotSignedIn = true;
}

Properties

FirstName FirstName FirstName FirstName FirstName

Contains the first name of the user. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

Id Id Id Id Id

Gets the user's unique Microsoft account identifier. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

IsBetaAccount IsBetaAccount IsBetaAccount IsBetaAccount IsBetaAccount

Indicates if the user is part of a beta program. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

IsConfirmedPC IsConfirmedPC IsConfirmedPC IsConfirmedPC IsConfirmedPC

Indicates if the user is on a PC that they have confirmed as their PC. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

LastName LastName LastName LastName LastName

Contains the user's last name. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

SafeCustomerId SafeCustomerId SafeCustomerId SafeCustomerId SafeCustomerId

Gets an obfuscated customer ID specific to the calling application. This ID allows your application to identify the user across sessions but cannot be used to share data between separate applications since each application will receive a distinct SafeCustomerId value for the same Microsoft account.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

SignInName SignInName SignInName SignInName SignInName

The sign in name of the user. This value is available only to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

Tickets Tickets Tickets Tickets Tickets

Contains an array of tickets that identify the user. If your app uses the JWT policy, only one ticket is returned. This value is only available to Microsoft application partners.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.