在从ADAL JS迁移到MSAL JS时面临的问题

问题描述 投票:0回答:1

希望大家都平安无事&,我正在将我的angular应用认证从ADAL JS迁移到MSAL JS。

在ADAL JS中,我的ADAL配置如下,认证工作如期进行。

adalConfig: {
    tenant: 'GUID',
    clientId: 'GUID',
    redirectUri: window.location.origin
    ......
    ...... // other properties
 }

在MSAL配置中,我尝试在app.module.ts中设置相同的属性。

MsalModule.forRoot({
      auth: {
          clientId: "GUID", // Same as the client ID of ADAL JS
          authority: https://login.microsoftonline.com/<tenant GUID>/, // Same as the tenant GUID of ADAL JS
          redirectUri: OAuthSettings.redirectUri, // This is your redirect URI
      },
      cache: {
        cacheLocation: 'localStorage',
       // storeAuthStateInCookie: true, // set to true for IE 11
    }

但是我一直收到这个错误

"请将 correlationId 设置为有效的指南"

我试着看了一下 文件 从微软那里得到的,但它没有提到任何关于权威。

任何帮助都将是非常感激的。

angular authentication azure-active-directory msal adal.js
1个回答
0
投票

correlationId 会在MSAL日志中看到。由于 文档 显示,correlationId是一个唯一的标识符,用于将请求与响应进行映射,以便进行调试。

你可以试试下面的代码 联系:

MsalModule.forRoot({
    clientID: '00000000-0000-0000-0000-000000000000',
    authority: "https://login.microsoftonline.com/common/",
    validateAuthority: true,
    redirectUri: window.location.origin,
    cacheLocation: 'localStorage',
    postLogoutRedirectUri: window.location.origin,
    navigateToLoginRequestUrl: false,
    popUp: false,
    unprotectedResources: ["https://www.microsoft.com/en-us/"],
    protectedResourceMap: protectedResourceMap,
    logger: loggerCallback,
    correlationId: "1000",
    level: LogLevel.Info,
    piiLoggingEnabled: true
})
....
© www.soinside.com 2019 - 2024. All rights reserved.