Currently, I am attempting to incorporate Ms ADAL into my Ionic 4 project, but encountering the following issue:
Authentication failed Error: User cancelled the flow RequestId
Below is a snippet of my code:
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));
https://i.sstatic.net/j6jDu.png
If anyone can offer assistance, it would be greatly appreciated. Thank you!