Share via


UserIdentity クラス

定義

ユーザーに関連付けられている ID、チケット、およびその他の情報が含まれます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

public ref class UserIdentity sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UserIdentity final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UserIdentity
Public NotInheritable Class UserIdentity
継承
Object Platform::Object IInspectable UserIdentity
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

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

プロパティ

FirstName

ユーザーの名を格納します。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

Id

ユーザーの一意の Microsoft アカウント識別子を取得します。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

IsBetaAccount

ユーザーがベータ プログラムの一部であるかどうかを示します。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

IsConfirmedPC

ユーザーが PC として確認した PC 上にあるかどうかを示します。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

LastName

ユーザーの姓を含みます。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

SafeCustomerId

呼び出し元のアプリケーションに固有の難読化された顧客 ID を取得します。 この ID を使用すると、アプリケーションはセッション間でユーザーを識別できますが、各アプリケーションが同じ Microsoft アカウントに対して個別の SafeCustomerId 値を受け取るので、個別のアプリケーション間でデータを共有するために使用することはできません。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

SignInName

ユーザーのサインイン名。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

Tickets

ユーザーを識別するチケットの配列が含まれます。 アプリで JWT ポリシーを使用している場合は、チケットが 1 つだけ返されます。 この値は、Microsoft アプリケーション パートナーのみが使用できます。

Note

Windows 10以上の開発を行う場合は、代わりに Windows.Security.Authentication.Web.Core API を使用してください。 詳細については、「 Web アカウント マネージャー」を参照してください。

適用対象