UserIdentity UserIdentity UserIdentity UserIdentity Class

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.

Syntax

Declaration

public sealed class UserIdentitypublic sealed class UserIdentityPublic NotInheritable Class UserIdentitypublic sealed class UserIdentity

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 summary

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.

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.

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.

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.

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.

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.

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.

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.

Properties

  • 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.

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

    Property Value

    • string
      string
      string
      string

      The user's first name.

  • 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.

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

    Property Value

    • string
      string
      string
      string

      The user's unique Microsoft account identifier.

  • 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.

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

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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.

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

    Property Value

    • bool
      bool
      bool
      bool

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

  • 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.

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

    Property Value

    • string
      string
      string
      string

      The user's last name.

  • 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.

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

    Property Value

    • string
      string
      string
      string

      An obfuscated customer ID specific to the calling application.

  • 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.

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

    Property Value

    • string
      string
      string
      string

      The name of the user.

    Remarks

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

  • 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.

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

    Property Value

    • An array of tickets that identify the user.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Security.Authentication.OnlineId.dll