1

MSAL ライブラリを使用してアクセス トークンを生成する dotnet コア コンソール アプリを作成しています。このリンクに記載されているすべての制約が私がいる組織によって満たされているため、統合 Windows 認証を使用しています。これは、MSAL 4.15.0 ライブラリ バージョンで正常に動作するようです。しかし、MSAL 4.16.0 バージョンの使用を開始すると、次の例外が発生します。

Inner Excception: MSAL.NetCore.4.16.0.0.MsalServiceException:
        ErrorCode: federated_service_returned_error
Microsoft.Identity.Client.MsalServiceException: Federated service at <URL> returned error:
   at Microsoft.Identity.Client.WsTrust.WsTrustWebRequestManager.GetWsTrustResponseAsync(WsTrustEndpoint wsTrustEndpoint, String wsTrustRequest, RequestContext requestContext)
   at Microsoft.Identity.Client.WsTrust.CommonNonInteractiveHandler.GetWsTrustResponseAsync(UserAuthType userAuthType, String cloudAudienceUrn, WsTrustEndpoint endpoint, String username, SecureString securePassword)
        StatusCode: 401
        ResponseBody:
        Headers: Date: Mon, 10 Aug 2020 20:24:54 GMT
Cache-Control: no-cache, no-store
Pragma: no-cache
WWW-Authenticate: Negotiate
Set-Cookie: PF=QSEPNWjNTF0s1lakkLKluT;Path=/;Secure;HttpOnly;SameSite=None
Transfer-Encoding: chunked
<---

私が書いた簡単なコードは次のとおりです。

            app = PublicClientApplicationBuilder.Create(clientId).WithTenantId(tenant).WithAuthority(authority).Build();
            try
            {
                Task<AuthenticationResult> result = app.AcquireTokenByIntegratedWindowsAuth(scopes).WithUsername(username).ExecuteAsync();
                Console.Write(result.Result.AccessToken);
                Console.ReadLine();
            }

さらに明確にするために、これはMSAL 4.15.0まで正常に動作します。バージョンMSAL 4.16.0 以降から失敗し始めます。

理由はありますか?

4

1 に答える 1