【发布时间】:2021-12-14 15:49:01
【问题描述】:
我们使用的是 Microsoft.Identity.Client nuget 库版本 4.x,我们能够验证社交身份提供者(如 facebook)以及使用 azure b2c 用户流的一些第三方提供者。在使用我们的 Azure AD SSO 进行身份验证时,我们在应用程序中收到一个错误,显示“请求的查询字符串太长”。但是在网络上我们没有这样的问题。
通过 MS 的一些研究和支持帮助论坛,我们发现我们需要从应用程序端修改代码并发送 POST 请求而不是 GET,以便 SAML 请求不会出错。
知道 Microsoft.Identity.Client nuget 库是否允许我们这样做吗?
我们通常使用如下代码来初始化并调用获取令牌方法。
PublicClientApp = PublicClientApplicationBuilder.Create(AuthServiceConfiguration.ClientId)
.WithB2CAuthority(AuthServiceConfiguration.Authority)
.Build();
AuthenticationResult authResult = await PublicClientApp.AcquireTokenInteractive(AuthServiceConfiguration.ApiScopes)
.WithAccount(GetAccountByPolicy(accounts, AuthServiceConfiguration.PolicySignUpSignIn))
.WithPrompt(Prompt.SelectAccount)
.ExecuteAsync()
【问题讨论】:
标签: c# .net asp.net-mvc azure-ad-b2c msal