小编vci*_*ial的帖子

是否可以使用由不同版本的 Angular 构建的不同角度元素

我想知道是否可以使用不同版本的 Angular 构建的不同角度元素(自定义元素)。我听说 zone.js 正在污染全局范围。

感谢您的回答。

javascript web-component custom-element angular

7
推荐指数
1
解决办法
1405
查看次数

msal acquireTokenSilent 失败,静默身份验证被拒绝

我正在使用 msal-Angular,但无法使用 MsalInterceptor,因为它处理每个请求,而我希望它仅处理图形请求。因此,我试图在我的应用程序中自己获取令牌。

我这样做:MsalModule 的配置

MsalModule.forRoot({
  auth: {
    clientId: 'xxxxxx',
    authority: 'https://login.microsoftonline.com/common',
    redirectUri: 'my_url',
  },
  cache: {
    cacheLocation: 'localStorage',
    storeAuthStateInCookie: false, // set to true for IE 11
  },
},
  {
    popUp: true,
    consentScopes:[
      'user.read',
      "calendars.read",
      "calendars.read.shared",
      "calendars.readwrite",
      "group.read.all",
      "openid",
      "profile"
    ],
  }),
Run Code Online (Sandbox Code Playgroud)

我正在做这样的登录:

this.msalService.loginPopup({scopes: [
  'user.read',
  "calendars.read",
  "calendars.read.shared",
  "calendars.readwrite",
  "group.read.all",
  "openid",
  "profile"
]})
Run Code Online (Sandbox Code Playgroud)

我像这样拦截登录成功

this.broadcastService.subscribe('msal:loginSuccess' ...
Run Code Online (Sandbox Code Playgroud)

我正在尝试获得这样的令牌

const result: AuthResponse = await this.msalService.acquireTokenSilent({scopes: [
  'user.read',
  "calendars.read",
  "calendars.read.shared",
  "calendars.readwrite",
  "group.read.all",
  "openid",
  "profile"
]}).catch((error) => {
  console.log(error);
});
Run Code Online (Sandbox Code Playgroud)

我仍然收到此错误:静默身份验证被拒绝。用户必须首先登录,并根据需要授予客户端应用程序对“user.read calendars.read …

graph azure-ad-msal

5
推荐指数
1
解决办法
1万
查看次数