The authentication using the msal.js v 0.1.5 fails with ionic framework v 3.0. It seems that storage is not being written out on response. The same sample works with msal.js version 0.1.1. However, msal.js version 0.1.1 fails authentication when deployed to an android device. The behavior on android device gives a Bad Request error with v0.1.1. Attached is the project with complete code that shows the error with the fabrikamb2c.onmicrosoft.com tenant.
To run the sample ( follow https://ionicframework.com/docs/intro/installation/)
yourfolder - npm install
yourfolder - ionic serve
regards,
Narinder.
ionic-app-using-msalv015.zip
Thanks Rohit, for taking the lead on this. We would like to make this version work for android and iOS too. Let me know, if you need any more information or jump on a call to resolve.
Let me know, if this library is supported for ASP.NET/Cordova/ionic development or any further information is needed.
regards,
Narinder.
@narindermakin For Cordova, Ionic and other mobile app development frameworks, the library needs to interact with the native device constructs and we do not have such plugins today. Msal.js is designed to support authentication flows only for Single Page Applications and JS in web apps .
For supporting ASP.NET app authentication please look at Msal .Net.
Does that mean client cannot be written to Azure AD B2C if application is Cordova / Ionic? The Msal.Net is not applicable in this scenario. We were able to make Msal.Js work to a point by just fixing a window.location.replace method to a cordova.inAppBrowser.open. The code fix is in UserAgentApplication.ts. The window.location.replace is not supported well on android browsers. The service does return the token back but does not deeplink to the app.
Is there any plan of Azure AD B2C / MSAL.JS to support a Cordova client or usage is restricted to Xamarin / .NET client only. That indeed is a big limitation, if it exists.
It would be great to see some movement on this, very disappointing to not be able to use this with angular and cordova apps like you would make with Ionic.
@narindermakin @MrTechGadget Can you please update the issue as per our new template. If you already know the fix, we would be more than happy to review your PR. You also mentioned that The window.location.replace is not supported well on android browsers, can you please confirm which browser you are using?
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Library version: X.Y.Z
## Current behavior
## Expected behavior
## Minimal reproduction of the problem with instructions
Does this help fix this long pending issue? We gave up on it 8 months back due to lack of support.
On Friday, November 16, 2018, 4:54:17 PM EST, wenYorker notifications@github.com wrote:
@narindermakin @MrTechGadget Can you please update the issue as per our new template.
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Browser:
Library version
Library version: X.Y.Z
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@narindermakin The library is designed to be used in JS applications in the web browser.
The following Microsoft libraries support development in mobile applications: MSAL Android, MSAL iOS and MSAL.net for Xamarin apps.
We do not have plans to support Cordova or Ionic mobile frameworks using MSAL.js. Closing this issue.
Thank you for your response. However, the MSAL support across is not ready for primetime and creates a bigger issue in the adoption of Azure AD B2C at this time.
Hi @narindermakin is there any other way using MSAL or ADAL JS for Ionic 4? Any help is appreciated. I am developing a mobile app with Ionic 4 which needs the authentication from Azure AD.
Hi @narindermakin is there any other way using MSAL or ADAL JS for Ionic 4? Any help is appreciated. I am developing a mobile app with Ionic 4 which needs the authentication from Azure AD.
I've forked this one and just fixed small things needed to run it also with cordova 9. Maybe this would help: https://github.com/alesrosina/azure-activedirectory-library-for-cordova
I am slightly surprised at the won't fix approach, although it may not be an issue that needs fixing here.
It should be noted that Angular & Ionic applications running under Cordova typically are SPA, only touching the client device via plugins. 90% of the application is JS running in a browser context.
@narindermakin The library is designed to be used in JS applications in the web browser.
The following Microsoft libraries support development in mobile applications: MSAL Android, MSAL iOS and MSAL.net for Xamarin apps.We do not have plans to support Cordova or Ionic mobile frameworks using MSAL.js. Closing this issue.
My customer is also interested by the support of Cordova / Ionic mobile application with MSAL.
Should we understand that it will never be supported? 😒
@navyasric Can you comment?
Most helpful comment
Does that mean client cannot be written to Azure AD B2C if application is Cordova / Ionic? The Msal.Net is not applicable in this scenario. We were able to make Msal.Js work to a point by just fixing a window.location.replace method to a cordova.inAppBrowser.open. The code fix is in UserAgentApplication.ts. The window.location.replace is not supported well on android browsers. The service does return the token back but does not deeplink to the app.
Is there any plan of Azure AD B2C / MSAL.JS to support a Cordova client or usage is restricted to Xamarin / .NET client only. That indeed is a big limitation, if it exists.