User​Identity User​Identity User​Identity 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 : IUserIdentitypublic sealed class UserIdentity : IUserIdentityPublic NotInheritable Class UserIdentity Implements IUserIdentity
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

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

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.

public string FirstName { get; }public string FirstName { get; }Public ReadOnly Property FirstName As string
Value
string string string

The user's first name.

Attributes

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.

public string Id { get; }public string Id { get; }Public ReadOnly Property Id As string
Value
string string string

The user's unique Microsoft account identifier.

Attributes

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.

public bool IsBetaAccount { get; }public bool IsBetaAccount { get; }Public ReadOnly Property IsBetaAccount As bool
Value
bool bool bool

True if the user is part of a beta program; false otherwise.

Attributes

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.

public bool IsConfirmedPC { get; }public bool IsConfirmedPC { get; }Public ReadOnly Property IsConfirmedPC As bool
Value
bool bool bool

True if the user is on a confirmed PC; false otherwise.

Attributes

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.

public string LastName { get; }public string LastName { get; }Public ReadOnly Property LastName As string
Value
string string string

The user's last name.

Attributes

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.

public string SafeCustomerId { get; }public string SafeCustomerId { get; }Public ReadOnly Property SafeCustomerId As string
Value
string string string

An obfuscated customer ID specific to the calling application.

Attributes

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.

public string SignInName { get; }public string SignInName { get; }Public ReadOnly Property SignInName As string
Value
string string string

The name of the user.

Attributes

Remarks

Third-party app developers should use the Live SDK to get access to equivalent functionality.

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.

public IVectorView<OnlineIdServiceTicket> Tickets { get; }public IVectorView<OnlineIdServiceTicket> Tickets { get; }Public ReadOnly Property Tickets As IVectorView<OnlineIdServiceTicket>
Value

An array of tickets that identify the user.

Attributes