OnlineIdAuthenticator.AuthenticatedSafeCustomerId OnlineIdAuthenticator.AuthenticatedSafeCustomerId OnlineIdAuthenticator.AuthenticatedSafeCustomerId OnlineIdAuthenticator.AuthenticatedSafeCustomerId OnlineIdAuthenticator.AuthenticatedSafeCustomerId Property

Definition

Returns the ID of a user who has been successfully authenticated for your app.

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 AuthenticatedSafeCustomerId { get; }
winrt::hstring AuthenticatedSafeCustomerId();
public string AuthenticatedSafeCustomerId { get; }
Public ReadOnly Property AuthenticatedSafeCustomerId As string
var string = onlineIdAuthenticator.authenticatedSafeCustomerId;

Property Value

string string string

The ID of a user who has been successfully authenticated for your app.

Examples

var authenticatedSafeCustomerId = onlineIdAuthenticator.authenticatedSafeCustomerId;
if (authenticatedSafeCustomerId !== "")
{
    // use
}

string authenticatedSafeCustomerId = onlineIdAuthenticator.authenticatedSafeCustomerId;
if (authenticatedSafeCustomerId != string.Empty)
{
    // use
}

Remarks

This property returns the same user ID as the UserIdentity.SafeCustomerId property.

If the user was not successfully authenticated for your app, this property value is empty.

If your app stores local data based on the user’s identity, you must check the authenticatedSafeCustomerId property to ensure there were no changes since the last authentication for your app. Check this property when your app is launched or activated, before getting the user identity and associated tickets.