クライアント証明書フローにMSALを使用するASP.NETコアアプリケーションを作成しようとしています。ASP.NET CoreでMSALを使用するアプリケーション専用トークンを取得するPlatformPlugin例外
NullReferenceException: Object reference not set to an instance of an object.
Microsoft.Identity.Client.Internal.PlatformPlugin.LoadPlatformSpecificAssembly()
認証がこのサンプルの後にモデル化されています:active-directory-dotnet-daemon-v2
マイアプリ:active-directory-dotnet-webapp-openidconnect-aspnetcore-v2
許可このサンプルの後にモデル化されたアクセストークンを取得しようとしたとき
は、私は次の例外を取得しますMail.Readアプリケーションのアクセス許可に登録されています。ここでは、例外をスローするコードは次のとおりです。
string authority = $"https://login.microsoftonline.com/{ tenantId }/v2.0";
ConfidentialClientApplication client = new ConfidentialClientApplication(
authority,
appId,
redirectUri,
new ClientCredential(appSecret),
null);//new TokenCache());
AuthenticationResult authResult = await client.AcquireTokenForClient(
new string[] { "Mail.Read" }, null);
return authResult.Token;
はまた、デーモンのサンプルのように、「https://graph.microsoft.com/.default」スコープでみました。