我第一次针对Azure Active Directory B2C进行开发。我正在开发一个WPF/桌面应用程序。
登录和注销一直运行得非常完美,直到今天,它停止了工作,并且在登录期间抛出了下面的异常。
AADB2C90079: Clients must send a client_secret when redeeming a confidential grant.有一个建议是,我需要刷新一个令牌,如堆栈溢出问题:Azure B2C Custom Policies: Invalid Request, client secret error中所概述的那样。
,但我一点也不知道该怎么做。
这是我的登录代码(等待PublicClientApp.AcquireTokenAsync(.)是什么引发了例外)
Public Async Function SignIn() As Task(Of Boolean)
Dim authResult As AuthenticationResult = Nothing
Dim accounts As IEnumerable(Of IAccount) = Await PublicClientApp.GetAccountsAsync()
Try
authResult = Await PublicClientApp.AcquireTokenAsync(ApiScopes, GetUserByPolicy(accounts, PolicySignUpSignIn), UIBehavior.SelectAccount, String.Empty, Nothing, Authority)
userProf = Await GetUserInformation()
SignInState = SignInStateEnum.SignedIn
Return True
Catch ex As MsalServiceException
Try
If ex.Message.Contains("AADB2C90118") Then
authResult = PublicClientApp.AcquireTokenAsync(ApiScopes, GetUserByPolicy(accounts, PolicySignUpSignIn), UIBehavior.SelectAccount, String.Empty, Nothing, AuthorityResetPassword).Result
userProf = GetUserInformation().Result
SignInState = SignInStateEnum.SignedIn
Return True
Else
logger.Error($"Error Acquiring Token:{Environment.NewLine}{ex}")
logger.Error("Exception Raised", ex)
userProf = Nothing
SignInState = SignInStateEnum.SignedOut
Return False
End If
Catch __unusedException1__ As Exception
logger.Error("Exception Raised", __unusedException1__)
userProf = Nothing
SignInState = SignInStateEnum.SignedOut
Return False
End Try
Catch ex As Exception
logger.Error($"Users:{String.Join(",", accounts.[Select](Function(u) u.Username))}{Environment.NewLine}Error Acquiring Token:{Environment.NewLine}{ex}")
logger.Error("Exception Raised", ex)
userProf = Nothing
SignInState = SignInStateEnum.SignedOut
Return False
End Try
End Function发布于 2019-04-05 02:05:08
这已经被确认为Azure问题--这是Azure支持部门给我的信息:“这个问题被发现是后端问题。我们的产品团队已经发现了问题并部署了修复程序。请您再试一次,让我知道它现在是否为您的租户工作?”
https://stackoverflow.com/questions/55525969
复制相似问题