エラーが発生しましたAADSTS70002:資格情報の検証中にエラーが発生しました。 AADSTS50012:クライアントのアサーションオーディエンス要求がRealm発行者デーモンMSALからMSGraphを使用
と一致しません。
string[] scopes = new string[]{"https://graph.microsoft.com/.default"};
var certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadOnly);
var cert = certStore.Certificates.Cast<X509Certificate2>().First(c => c.Thumbprint == "XXX-XXX etc");
var cas = new ClientAssertionCertificate(cert);
var cc = new Microsoft.Identity.Client.ClientCredential(cas);
var client = new Microsoft.Identity.Client.ConfidentialClientApplication("XX-XXX etc", "http://localhost", cc, new TokenCache(), new TokenCache());
var authResult = await client.AcquireTokenForClientAsync(scopes);
var dap = new DelegateAuthenticationProvider(rm =>
{
rm.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", authResult.AccessToken);
return Task.FromResult(0);
});
var gClient = new GraphServiceClient(dap);
gClient.Me.Dump();
AcquireTokenForClientAsync()
メソッドの呼び出しでエラーが発生しました。
ユーザー認証ができないMSALおよびデーモンクライアントのオンラインドキュメントは見つかりません。
提案?