angularjsionic2azure-active-directoryadal

Azure AD Authentication Error: User Cancelled the flow


I am trying to develop user authentication functionality of our application using Azure AD and having some issue in the process. I have implemented the client-flow authentication using ADAL library but when I try to login it is giving an error as below:

Error: User cancelled the flow RequestId:934620772 CorrelationId: 57a1ffe8-7612-49c4-b22d-2704eff74010
at fail (file:///android_asset/www/plugins/cordova-plugin-ms-adal/www/CordovaBridge.js:37:25)
at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:295:52)
at <anonymous>:1:9(anonymous function) @ main.js:121821_rejected @ utility.js:286Deferred.reject @ utility.js:368(anonymous function) @ AuthenticationContext.js:91_rejected @ utility.js:286Deferred.reject @ utility.js:368fail @ CordovaBridge.js:41cordova.callbackFromNative @ cordova.js:295(anonymous function) @ VM298:1

We are developing this app using Ionic 2 framework which uses Angular 2 and TypeScript. And I am using cordova-plugin-ms-adal library for my development.

Would appreciate if you could please help me in resolving this issue.


Solution

  • The issue was the "resourceUri" value I was using in order to connect with Azure AD using ADAL library (cordova-plugin-ms-adal).

    I was using my Azure App Service's URI but what it really needs is the Graph API URI (https://graph.windows.net).