Hi all,
I have implemented the MSAL plugin in on of our mobile apps. The user can login/logout without issues. However, during the login, the user gets 2 confirmation dialogs. This only applies to iOS, on Android we don't experience this issue.
The login has the following steps:
So my question is: how can I get rid of those 2 confirmation messages for iOS?
In the GitHub documentation there is an interesting section that looks related to this:
"webViewType (iOS only)
By default, MSAL picks a default web view type for sign in based on the version of iOS. For iOS 11 and up, this is an AuthenticationSession (ASWebAuthenticationSession or SFAuthenticationSession) which shows the "App wants to sign in with" permission dialog. If you do not require SSO and wish to avoid this permission dialog you can specify one of the other web view types to use - both of which avoid the permission dialog.
'SAFARI_VIEW_CONTROLLER'
Use a Safari web view for the sign in.
'WK_WEB_VIEW'
Use a plain WKWebView for sign in.
Here's an example usage:
window.cordova.plugins.msalPlugin.signInInteractive(mycbfunction(msg), myerrorfunction(errmsg), { prompt: 'LOGIN', authorizationQueryStringParameters: [{param: 'domain_hint', value: 'my-tenant-guid'}]; });"
The example doesn't contain a webViewType, so I tried to add this:
This appears to have no effect, on either of the confirmation dialogs.
Any ideas on what can be done to get rid of those 2 confirmation dialogs?
Hi Martijn,
While updating the plugin, I realized that I actually misremembered my code and misread my own documentation and led you astray. In addition, I left that piece of functionality out of the OutSystems Forge component.
You see, webViewType isn't supposed to live in AuthorizationQueryStringParameters. It's supposed to be specified at the top level in the opts object in SignInInteractive, but I never included that parameter in the component.
I have just finished my updates and I have released version 3.0.0 of the plugin that, among other changes, has this fix. There should be no breaking changes since the last version - the only reason it's a major revision is because the native library on the Android side has been updated two major revisions.
When you have time, please download the latest version and make sure your custom extensibility configuration (whether you've modified the eSpace or customized it in LifeTime) is pointing to the new url:
{
"plugin": {
"url": "https://github.com/wrobins/cordova-plugin-msal.git#3.0.0-beta.1",
...
Then, make sure when you've refreshed the reference to MsalPlugin, you reference the new WebViewType static entity.
Then, in SignInInteractive, you can specify WK_WEB_VIEW as one of the input parameters:
Please let me know if this fixes your issue. Thanks for your patience!
You're absolutely on the right track with where this additional confirmation dialog is coming from, and if you hadn't posted what you tried with AuthorizationQueryStringParameters, that's exactly what I would have suggested as that's the solution on paper.
You're in luck as I am currently working on updating this plugin as the native libraries it's using are getting out of date, so what I'm going to do is try to replicate this during my testing, and I'll post back here in the next few days with what I find, and either give you another workaround and/or fix whatever is causing this behavior with the next update. Again, this is something at the iOS system level with the default webview since iOS 11, but setting it to the in-app webview should have worked.
I'll post back here with updates.
Hi Walter,
That's good to hear! Really appreciate this, and so will the users!
Thanks for the new version of the MSAL plugin. I can confirm that the new WebViewType works as expected. On iOS we don't get those nasty confirmation dialogs anymore. So a big thank you to you!
We will do a regression test with the new version of the MSAL plugin. If some issue popups, I will let you know.
Thanks again!
Kind regards,
Martijn Ubbens