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

Property Value

String

Platform::String

winrt::hstring

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

Examples

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.

Applies to