WebAccountProvider.IsSystemProvider プロパティ

定義

指定された ID プロバイダーがシステム全体の認証トークンをサポートしているかどうかを示す値を取得します。

public:
 property bool IsSystemProvider { bool get(); };
bool IsSystemProvider();
public bool IsSystemProvider { get; }
var boolean = webAccountProvider.isSystemProvider;
Public ReadOnly Property IsSystemProvider As Boolean

プロパティ値

Boolean

bool

True を指定 すると、WebAccountProvider でシステム全体の認証トークンが許可されます。 それ以外の場合 は False

Windows の要件

デバイス ファミリ
Windows 10, version 1803 (10.0.17134.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v6.0 で導入)

デバイス全体のトークン取得のこの特殊なケースの例を次に示します。

// create a WebTokenRequest with device-wide authentication
WebTokenRequest CreateWebTokenRequestForAad(WebAccountProvider provider){
    // check if the ID provider allows system-wide scope, and construct token request accordingly:
    return new WebTokenRequest(
        provider,
        provider.IsSystemProvider ? "systemInfo" : "userInfo",
        "<InsertClientID>");
    )
}

// retrieve a device-wide auth token for Azure Active Directory
string GetAadToken() {
    var provider = WebAuthenticationCoreManager.FindSystemAccountProviderAsync(
        "https://login.microsoft.com","organizations");
    var request = CreateWebTokenRequestForAad(provider);
    var result = WebAuthenticationCoreManager.GetTokenSilentlyAsync(request);

    // handle the request result in the usual way.
    if (result.ResponseStatus == WebTokenRequestStatus.Success){ 
        return result.ResponseData[0].Token; 
    } else { 
        throw new Exception(result.ResponseError.ErrorMessage); 
    }     
} 

注釈

デバイス トークン機能は、ユーザーがデバイスにサインインする前にサービスがクラウド リソースに接続する必要がある場合 (たとえば、すぐに適用する必要がある System Center Configuration Manager (SCCM) ポリシーがある既定のエクスペリエンスなど) を対象としています。 デバイス全体のトークンを許可できるのは、ファースト パーティ ID プロバイダー (Xbox、MSA、AAD) のみです。他の ID プロバイダーはしません。

適用対象