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 : IUserIdentitypublic sealed class UserIdentity : IUserIdentityPublic NotInheritable Class UserIdentity Implements IUserIdentity// You can use this class in JavaScript.
- Attributes
| 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
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 : PlatForm::String FirstName { get; }public string FirstName { get; }Public ReadOnly Property FirstName As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::String Id { get; }public string Id { get; }Public ReadOnly Property Id As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::Boolean IsBetaAccount { get; }public bool IsBetaAccount { get; }Public ReadOnly Property IsBetaAccount As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean 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 : PlatForm::Boolean IsConfirmedPC { get; }public bool IsConfirmedPC { get; }Public ReadOnly Property IsConfirmedPC As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean 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 : PlatForm::String LastName { get; }public string LastName { get; }Public ReadOnly Property LastName As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::String SafeCustomerId { get; }public string SafeCustomerId { get; }Public ReadOnly Property SafeCustomerId As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::String SignInName { get; }public string SignInName { get; }Public ReadOnly Property SignInName As string// You can use this property in JavaScript.
- Value
- PlatForm::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 IReadOnlyList<OnlineIdServiceTicket> Tickets { get; }Public ReadOnly Property Tickets As IReadOnlyList<OnlineIdServiceTicket>// You can use this property in JavaScript.
- Value
- IVectorView<OnlineIdServiceTicket> IReadOnlyList<OnlineIdServiceTicket> IReadOnlyList<OnlineIdServiceTicket> IReadOnlyList<OnlineIdServiceTicket>
An array of tickets that identify the user.