AppComponent_Host ngfactory js 在 angular 8 app 中出现错误 [object Object]
Getting error [object Object] in AppComponent_Host ngfactory js in angular 8 app
我正在尝试从 Microsoft Identity 平台(使用 MSAL 库对 Azure AD 用户进行身份验证)运行 这个官方示例 angular app 并收到以下错误。我无法弄清楚到底是哪个软件包或版本导致了这个错误以及如何修复它。有什么想法吗?
VM61 AppComponent_Host.ngfactory.js:6 ERROR Error: [object Object]
at viewWrappedDebugError (VM21 vendor.js:84484)
at callWithDebugContext (VM21 vendor.js:95180)
at Object.debugCreateRootView [as createRootView] (VM21 vendor.js:94680)
at ComponentFactory_.push../node_modules/@angular/core/fesm5/core.js.ComponentFactory_.create (VM21 vendor.js:85367)
at ComponentFactoryBoundToModule.push../node_modules/@angular/core/fesm5/core.js.ComponentFactoryBoundToModule.create (VM21 vendor.js:83089)
at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.bootstrap (VM21 vendor.js:91935)
at VM21 vendor.js:91657
at Array.forEach ()
at PlatformRef.push../node_modules/@angular/core/fesm5/core.js.PlatformRef._moduleDoBootstrap (VM21 vendor.js:91657)
at VM21 vendor.js:91625
Msal 配置有问题。我正在设置权限值只是租户 ID Guid 如下
MsalModule.forRoot({
auth: {
clientId: 'xxxxxxxxxx-bxxxxx-4xxxxxx-9xxxxx-xxxxcf',
authority: 'xxxxxxxxxx-dddxxxxx-ffffxxxxx-8xxxxx-xxxxcs',
redirectUri: 'http://localhost:4202/',
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: isIE, // set to true for IE 11
},
},
{
popUp: !isIE,
consentScopes: [
'user.read',
'openid',
'profile',
],
unprotectedResources: [],
protectedResourceMap: [
['https://graph.microsoft.com/v1.0/me', ['user.read']]
],
extraQueryParameters: {}
})
权限值应该是authority(or Cloud_Instance_Id)/tenantId
例如
https://login.microsoftonline.com/xxxxxxxxxx-dddxxxxx-ffffxxxxx-8xxxxx-xxxxcs/
我希望如果 angular 或 Msal 库中有更好的 error/exception 可以给我们一个指示,它是 Msal 配置的问题。
希望对遇到同样问题的人有所帮助
我正在尝试从 Microsoft Identity 平台(使用 MSAL 库对 Azure AD 用户进行身份验证)运行 这个官方示例 angular app 并收到以下错误。我无法弄清楚到底是哪个软件包或版本导致了这个错误以及如何修复它。有什么想法吗?
VM61 AppComponent_Host.ngfactory.js:6 ERROR Error: [object Object] at viewWrappedDebugError (VM21 vendor.js:84484) at callWithDebugContext (VM21 vendor.js:95180) at Object.debugCreateRootView [as createRootView] (VM21 vendor.js:94680) at ComponentFactory_.push../node_modules/@angular/core/fesm5/core.js.ComponentFactory_.create (VM21 vendor.js:85367) at ComponentFactoryBoundToModule.push../node_modules/@angular/core/fesm5/core.js.ComponentFactoryBoundToModule.create (VM21 vendor.js:83089) at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.bootstrap (VM21 vendor.js:91935) at VM21 vendor.js:91657 at Array.forEach () at PlatformRef.push../node_modules/@angular/core/fesm5/core.js.PlatformRef._moduleDoBootstrap (VM21 vendor.js:91657) at VM21 vendor.js:91625
Msal 配置有问题。我正在设置权限值只是租户 ID Guid 如下
MsalModule.forRoot({
auth: {
clientId: 'xxxxxxxxxx-bxxxxx-4xxxxxx-9xxxxx-xxxxcf',
authority: 'xxxxxxxxxx-dddxxxxx-ffffxxxxx-8xxxxx-xxxxcs',
redirectUri: 'http://localhost:4202/',
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: isIE, // set to true for IE 11
},
},
{
popUp: !isIE,
consentScopes: [
'user.read',
'openid',
'profile',
],
unprotectedResources: [],
protectedResourceMap: [
['https://graph.microsoft.com/v1.0/me', ['user.read']]
],
extraQueryParameters: {}
})
权限值应该是authority(or Cloud_Instance_Id)/tenantId
例如
https://login.microsoftonline.com/xxxxxxxxxx-dddxxxxx-ffffxxxxx-8xxxxx-xxxxcs/
我希望如果 angular 或 Msal 库中有更好的 error/exception 可以给我们一个指示,它是 Msal 配置的问题。
希望对遇到同样问题的人有所帮助