[英]acr claim is null for the Active Directory B2C JWT token acquired using Angular SPA
I downloaded here from GITHUB an Azure Sample for using Azure Active Directory B2C (ADB2C) in Angular. I downloaded here from GITHUB an Azure Sample for using Azure Active Directory B2C (ADB2C) in Angular. Please consider that ADB2C on Azure Portal has been successfully configured by me and is able to interact with my Angular application.请考虑我已成功配置 Azure 门户上的 ADB2C,并且能够与我的 Angular 应用程序交互。 Infact I'm happily able to sign-up a new user without problem.事实上,我很高兴能够毫无问题地注册一个新用户。
But, once I signin, it always returns the following message:但是,一旦我登录,它总是返回以下消息:
Password has been reset successfully.密码已成功重置。 Please sign-in with your new password请使用您的新密码登录
I tryied to reset the password, but I always receive the same.我尝试重置密码,但我总是收到相同的密码。 I inspected the Microsoft Code and I discovered this line:我检查了Microsoft 代码,发现了这一行:
if (success.idToken.claims['acr'] !== b2cPolicies.names.signUpSignIn) {
window.alert("Password has been reset successfully. \nPlease sign-in with your new password");
return this.authService.logout()
}
I investigated a little bit further and I realized that the generated ADB2C JWTToken is missing the "acr" claim.我进一步调查了一下,我意识到生成的 ADB2C JWTToken 缺少“acr”声明。 And here , on Microsoft Official Documentation, they wrote: 在这里,在微软官方文档中,他们写道:
Used only with older policies.仅与旧策略一起使用。 So I'm wondering:所以我想知道:
Thanks谢谢
Got it sorted out.搞定了I quote the answer that Derisen (the author) reply to me here on GitHub:我引用 Derisen(作者)在 GitHub 上回复我的答案:
And I realized that on Azure Portal, in the ADB2C section, you can change the setting:我意识到在 Azure 门户上,在 ADB2C 部分,您可以更改设置:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.