getting 'UnsupportedAuthorityValidation' error in react while using react-azure-adb2c library

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 15:37:34

问题


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

回答1:


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

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.

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.

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



来源:https://stackoverflow.com/questions/61453943/getting-unsupportedauthorityvalidation-error-in-react-while-using-react-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!