UserIdentity class

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


var userIdentity = getResults();

Members

The UserIdentity class has these types of members:

Properties

The UserIdentity class has these properties.

PropertyAccess typeDescription

FirstName

Read-only

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

Id

Read-only

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

IsBetaAccount

Read-only

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

IsConfirmedPC

Read-only

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

LastName

Read-only

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

SafeCustomerId

Read-only

Gets an obfuscated customer ID specific to the calling application.

SignInName

Read-only

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

Tickets

Read-only

Contains an array of tickets that identify the user

 

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;
}

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Security.Authentication.OnlineId
Windows::Security::Authentication::OnlineId [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8

Namespace

Windows.Security.Authentication.OnlineId
Windows::Security::Authentication::OnlineId [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

 

 

Show:
© 2016 Microsoft