0

我正在尝试通过 Azure Active Directory for React 应用程序实现身份验证。当我运行我的应用程序时,登录后我得到一个空白页面。在控制台中,我看到:“[HMR] 等待来自 WDS 的更新信号...”

这是我的提供者:

export const authProvider = new MsalAuthProvider(
    {
        auth: {
            authority: "https://login.microsoftonline.com/common",
            clientId: "********-****-****-****-************",
            postLogoutRedirectUri: window.location.origin,
            redirectUri: window.location.origin,
            knownAuthorities: [],
            navigateToLoginRequestUrl: true,
        },
        cache: {
            cacheLocation: 'sessionStorage',
            storeAuthStateInCookie: true,
        },
    },
    {
        scopes: [
            'user.read',
            'api://********-****-****-****-************/Read'
        ]
    },
{
        loginType: LoginType.Redirect,
        tokenRefreshUri: window.location.origin + '/auth.html'
    }
);

包:react-aad-msal

在 Azure 中:我有一个应用注册,带有 SPA 平台。重定向 URI:http://localhost:3000。

有人有想法吗?我尝试了很多东西,并阅读了它,但没有结果。

提前致谢!

4

1 回答 1

0

(从评论转移到回答,以便其他人更容易找到它)

通过将授权 URL 从Common更改为指定单个TenantID为客户解决了该问题。

于 2020-12-16T16:57:36.143 回答