我试图将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));
任何帮助?谢谢!
我现在遇到相同的问题。
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 ...”。
请帮助吗?
谢谢