have a cordova application in which i am using Cordova plugin (cordova-plugin-ms-adal)Active Directory Authentication Library (ADAL) .I want to authenticate the user using Single Sign On feature of Microsoft Azure.The scenario which is working fine for
me now is :- Working Scenario:- using the plugin as :-
var authContext = new Microsoft.ADAL.AuthenticationContext("https://login.windows.net/common");
authContext.acquireTokenAsync("https://graph.windows.net",ClientID, 'msal9314af11-xxxx-4058-xxxx-9f7e60c3d9d5://auth', '', '')
And in Response I am getting Response in Token and token Expiry Date Successfully:-
console.log("Token acquired: " + authResponse.accessToken);
console.log("Token will expire on: " + authResponse.expiresOn);
From the Above I am able to access the web api`s which is also hosted in Azure Active Directory.
Scenario Failed :- Using Brokered Authentication for Android using MS Adal Cordova
Plugin I will Set the Below code
Microsoft.ADAL.AuthenticationSettings.setUseBroker(true);
var authContext = new Microsoft.ADAL.AuthenticationContext("https://login.windows.net/common");
authContext.acquireTokenAsync("https://graph.windows.net",ClientID, 'msauth://PackageName/base64EncodeString', '', '')
And in Response I am getting Response in Token and token Expiry Date Successfully:-
console.log("Token acquired: " + authResponse.accessToken);
console.log("Token will expire on: " + authResponse.expiresOn);
Using Microsoft.ADAL.AuthenticationSettings.setUseBroker(true); I am getting
Enroll Device when i sign in to my microsoft account because the User is set in Conditional
Access policy for Device Compliance. I will enroll the Device and Microsoft Intune is installed in my phone. The Enrollment is SuccessFull And i get my account to select the next time i open the app but the Web Api`s are Called I get the response
from the Web API as Microsoft
Sign In HTML Page in return . API is not returning json DATA which is Expected.