gpt4 book ai didi

c# - 使用集成 Windows 身份验证时出现 MSAL 4.16.0 问题

转载 作者:行者123 更新时间:2023-12-03 03:58:50 26 4
gpt4 key购买 nike

我正在编写一个 dotnet core 控制台应用程序,它利用 MSAL 库生成访问 token 。我正在使用集成 Windows 身份验证作为 this 中提到的所有约束。我所在的组织对链接感到满意。这似乎适用于 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开始失败及以上。

有什么想法吗?

最佳答案

对于遇到此问题的人来说,这是一个已知错误,正在调查中。查看Github

关于c# - 使用集成 Windows 身份验证时出现 MSAL 4.16.0 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63386019/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com