Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication using the msal.js v 0.1.5 fails with ionic framework v 3.0 #271

Closed
narindermakin opened this issue Mar 16, 2018 · 15 comments
Closed
Assignees
Labels
more-information-needed Use this label when you are waiting on information from the issue creator

Comments

@narindermakin
Copy link

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

@rohitnarula7176 rohitnarula7176 self-assigned this Mar 16, 2018
@narindermakin
Copy link
Author

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.

@narindermakin
Copy link
Author

Let me know, if this library is supported for ASP.NET/Cordova/ionic development or any further information is needed.

regards,
Narinder.

@navyasric
Copy link
Contributor

@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.

@narindermakin
Copy link
Author

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.

@nehaagrawal nehaagrawal added the enhancement Enhancement to an existing feature or behavior. label Jul 18, 2018
@MrTechGadget
Copy link

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.

@nehaagrawal
Copy link
Contributor

nehaagrawal commented Nov 16, 2018

@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?

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:

  • Chrome version XX
  • Firefox version XX
  • IE version XX
  • Edge version XX
  • Safari version XX

Library version


Library version: X.Y.Z



## Current behavior



## Expected behavior



## Minimal reproduction of the problem with instructions



@nehaagrawal nehaagrawal added more-information-needed Use this label when you are waiting on information from the issue creator feature Feature requests. and removed enhancement Enhancement to an existing feature or behavior. feature Feature requests. labels Nov 16, 2018
@narindermakin
Copy link
Author

narindermakin commented Nov 17, 2018 via email

@navyasric navyasric assigned navyasric and unassigned nehaagrawal Jan 24, 2019
@navyasric
Copy link
Contributor

@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.

@narindermakin
Copy link
Author

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.

@cnuis2cool
Copy link

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.

1 similar comment
@awadeyar
Copy link

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.

@alesrosina
Copy link

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

@caramorsimon
Copy link

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.

@MCKLMT
Copy link

MCKLMT commented Feb 7, 2020

@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? 😒

@MCKLMT
Copy link

MCKLMT commented Feb 10, 2020

@navyasric Can you comment?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
more-information-needed Use this label when you are waiting on information from the issue creator
Projects
None yet
Development

No branches or pull requests

10 participants