msal.js 在 React 中 - Azure 身份验证

msal.js in React - Azure authentication

我遇到了错误,但在 azure 中的所有访问都是正常的。也许我的端点是错误的?你有什么想法吗?

错误 APP_TEST 需要访问您组织中只有管理员才能授予的资源的权限。请先让管理员授予此应用的权限,然后才能使用它。

我用这个

例子

TenanId = 11111111 ClientID = 22222222

export const msalConfig = {
    authority: 'https://login.microsoftonline.com/11111111',
    clientId: '22222222',
    redirectUri: document.getElementById('root').baseURI
};

 msalAuth = new UserAgentApplication({
        auth: msalConfig,
      });

您需要在 AAD 中打开您的应用程序 22222222 并授予添加的权限。看到这个屏幕: