MS ADAL集成:身份验证失败,错误:用户取消了Ionic 4上的流RequestId

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

我试图将Ms ADAL集成到离子4上,但我得到了

验证失败错误:用户取消了流RequestId

我的代码:

import { MSAdal, AuthenticationContext, AuthenticationResult } from '@ionic-native/ms-adal/ngx';

constructor(
private msAdal: MSAdal
  ) {}

  let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
      authContext.acquireTokenAsync('https://graph.windows.net', 'MY-ID-CLIENT', 'http://localhost:8000/','','')
      .then((authResponse: AuthenticationResult) => {
        console.log('Token is' , authResponse.accessToken);
        console.log('Token will expire on', authResponse.expiresOn);
      })
      .catch((e: any) => console.log('Authentication failed', e));

error screenshot

任何帮助?谢谢!

typescript cordova ionic4 adal
1个回答
0
投票

我现在遇到相同的问题。

let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
authContext.acquireTokenAsync('https://graph.windows.net/', '2e0d429a-c74f-4a3d-ac74-xxxxxxxxx', 'https://myURL','','')
  .then((authResponse: AuthenticationResult) => {
    console.log('Token is' , authResponse.accessToken);
    console.log('Token will expire on', authResponse.expiresOn);
  })
  .catch((e: any) => console.log('Authentication failed', e));

}

我的resourceUrl是https://graph.windows.net/,但我不断收到“身份验证失败错误:用户在控制台中取消了流RequestId:239722795 CorrelationId ...”。

请帮助吗?

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.