我正在尝试通过Azure Active Directory为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。
有谁有主意吗?我尝试了很多东西,也读了一些关于它的文章,但是没有结果。
提前感谢!
发布于 2020-12-17 00:57:36
(从评论转到答案,以便其他人更容易找到它)
通过将授权URL从通用更改为指定单个TenantID,为客户解决了此问题。
https://stackoverflow.com/questions/65008483
复制相似问题