使用react-azure-adb2c库时在React中收到'UnsupportedAuthorityValidation'错误 [英] getting 'UnsupportedAuthorityValidation' error in react while using react-azure-adb2c library

查看:92
本文介绍了使用react-azure-adb2c库时在React中收到'UnsupportedAuthorityValidation'错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码通过azure adb2c进行身份验证并获取访问令牌.我正在使用'react-azure-adb2c'msal库.我也尝试使用( https://login.microsoftonline.com/tfp/)实例值

I'm using this code to authenticate and to get access token using azure adb2c. And i'm using 'react-azure-adb2c' msal library. i tried using (https://login.microsoftonline.com/tfp/) instance value as well.

import b2cauth from 'react-azure-adb2c';
b2cauth.initialize({
  instance: 'https://MyPortaldemo.b2clogin.com/tfp/', 
  tenant: '4f7d3971-9a3b-4a58-9342-ab0ffc4b842a',
  signInPolicy: 'B2C_1_signupsigninmydemoapp',   
  applicationId: 'ad8597bc-484b-495e-b968-ce91b60c4947',
  cacheLocation: 'sessionStorage',
  scopes: ['https://MyPortaldemo.onmicrosoft.com/apireact/user_impersonation','openid'],
  //redirectUri: 'http://localhost:3000',
  postLogoutRedirectUri: window.location.origin,
});
b2cauth.run(() => {
  ReactDOM.render(<App />, document.getElementById('root'));
  serviceWorker.unregister();
});

and i'm getting this error

推荐答案

将您的评论概括为答案,以帮助遇到相同问题的其他人.

Summarize your comment as answer to help others who have the same problem.

在Azure Active Directory B2C(Azure AD B2C)应用程序中设置用于登录和登录的身份提供程序时,需要指定重定向URL.您不应再在应用程序和API中引用login.microsoftonline.com.相反,对所有新应用程序使用 b2clogin.com ,并将现有应用程序从 login.microsoftonline.com 迁移到 b2clogin.com .

When you set up an identity provider for sign-up and sign-in in your Azure Active Directory B2C (Azure AD B2C) application, you need to specify a redirect URL. You should no longer reference login.microsoftonline.com in your applications and APIs. Instead, use b2clogin.com for all new applications, and migrate existing applications from login.microsoftonline.com to b2clogin.com.

login.microsoftonline.com 的弃用于2020年12月4日对所有Azure AD B2C租户生效,向现有租户提供一年的迁移时间以迁移到b2clogin.com . 2019年12月4日之后创建的新租户将不接受来自 login.microsoftonline.com 的请求.所有功能在 b2clogin.com 终结点上均保持不变

The deprecation of login.microsoftonline.com goes into effect for all Azure AD B2C tenants on 04 December 2020, providing existing tenants one year to migrate to b2clogin.com. New tenants created after 04 December 2019 will not accept requests from login.microsoftonline.com. All functionality remains the same on the b2clogin.com endpoint.

有关更多详细信息,您可以参考有关将应用程序和API迁移到b2clogin.com .

For more details, you could refer to this article about migrating applications and apis to b2clogin.com.

这篇关于使用react-azure-adb2c库时在React中收到'UnsupportedAuthorityValidation'错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆