122
Views
5
Comments
[InAppBrowserEvents] How to use InAppBrowserEvents together with Microsoft Login Connector?
Question
inappbrowserevents
Mobile icon
Forge asset by Rui Barbosa
Application Type
Mobile

So we have a mobile app that uses Microsoft Login Connector as the authenticator. The login in android devices works fine. But in iOS, after successful authentication, its getting stucked in the splash screen, although upon restarting the application it will start fine and proceed to the homepage (already logged-in)

I tried to use the InAppBrowserEvents to open the URL from Microsoft Login authenticator and after successful authentication, I've added a logic to close the in-app browser and proceed to the homepage. This works fine in android aswell. But in iOS, it will just return to the login page instead of the homepage since upon checking of GetUserId() it is returning 0, meanwhile in android it returns the user id of the current user. And similarly, restarting the app in iOS will start fine and proceed to the homepage (already logged-in).

Anyone knows how to solve this problem? TIA

2022-09-14 15-31-13
Roberto García

Did you find an Exception in service center saying 'Invalid login' and the details you see 'Invalid CSRF request' try to follow the following link for updating the settings in Safari.

https://support.rezdy.com/hc/en-us/articles/360055996634-Cross-Site-Tracking-Prevention-on-iOS-Mac-OS

If it starts working you know what the problem is: several redirections across domains during the login process (from microsoft login to the corporate login page and then back to the app home screen).

Hope this helps.

Roberto

UserImage.jpg
Kenneth Alberto

No 'Invalid login' logs in Service center.

The only errors Im getting when it is being stucked in the Splash screen:

Upgrade failed - rolling back to previous application version.
Running on native but cordova wasn't loaded

OSCache was not initialized because Cordova was not loaded.
Running on native but cordova wasn't loaded

2022-09-14 15-31-13
Roberto García

Are you testing on a real device or in an emulator? 

Only real devices have cordova.

UserImage.jpg
Kenneth Alberto

I am testing on real device. That error only happens for iOS

2022-09-14 15-31-13
Roberto García

Hi, 

 The only one thing I can recommend you is to take a look at 2 components on Forge:

 IdP mobile and IdP (IdP mobile consumes consumes IdP) .

There is a demo IdP Mobile sample that uses InAppsBrowser for the same purpose than you (SamlLogin screen). Maybe you can look at it and follow how they use InAppsBrowser to find a solution (not necessary to configure and execute, just follow the code).

 I'm using that component and works in iOS too.

Hope this helps.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.