-api-id | -api-type |
---|---|
T:Windows.Security.Authentication.OnlineId.UserIdentity |
winrt 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.
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;
}