wrobins / cordova-plugin-msal

Use the newest Microsoft MSAL library in your Cordova-based project!
Apache License 2.0
23 stars 63 forks source link

How to integrate plugin with Angular 9 Capacitor 2.0 project ? #37

Open mahmoudchebbani opened 4 years ago

mahmoudchebbani commented 4 years ago

I try to import the module into my typescript code however, typescript compiler is unable to find the module.

aplongh commented 3 years ago

My team did manage to integrate this plugin with Angular9, Ionic and Capacitor. However the process is extremely manual and gets "broken" each time an npm install is executed (for example, in a CI/CD scenario).

The process is as follows:

  1. instead of "ionic cordova plugin add cordova-plugin-msal....", justo do plain old "npm install --save cordova-plugin-msal"
  2. open plugin.xml file in "./node_modules/cordova-plugin-msal"
  3. replace $TENANTID, $CLIEND_ID and $KEY_HASH with the actual values (both for android and ios)
  4. for Android, manually add the following activity inside
  5. for iOS, add the following inside CFBundleURLTypes in info.plist CFBundleTypeRole Editor CFBundleURLSchemes msauth.io.ionic.starter
  6. for iOS add the following and the following lines just before the closing tags in info.plist LSApplicationQueriesSchemes msauthv2 msauthv3

As I said, this method works and we are able to signing to AAD. The downside is that for every "new" npm install, you need to repeat the process again.

If anyone has a better solution....

Regards, Ariel

CarlosDez23 commented 2 years ago

Hey! Is there any update on that? Ariel, could you send me a picture of your plugin.xml file? Thanks!!