我正在尝试通过 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。
有人有想法吗?我尝试了很多东西,并阅读了它,但没有结果。
提前致谢!