So here is my issue, I am connecting to an internal site that must be logged into before access can be gained. I can access it just fine from chrome when I use the in app browser but I get a 401 access denied when I connect in webview. Normally there is an alert that ask for login credentials and like I said it works on chrome but will not popup in in app browser. I am using ionic 3 with in app browser plugin.
Hello, Im having the same exact problem.
What I found out so far was that one can use InAppBrowser to open the page using the ‘_system’ browser where the popup login works. The only problem is that you then loos the connection to the app.
To fix this you could probably use deep linking and redirect to the app after login (havent tried yet).
What I intended to do was to redirect to a random page, listen for the pageloadeddone event (fires on redirects, have tested that) and then execute javasript code using InAppBrowser to get the token.
The problem is that the login only works with the system browser, but there I cannot see any event, nor can I execute a script in it, and the ‘_self’ and ‘_blank’ webview down seem to support the popup.
If you have any other ideas or already solved the problem, please let me know!!!
Yep, this is because you need a real popup to support the login and send data back to youir app, but real popups cannot be opened within the webview.
Ok so there’s a solution to this: Popup bridge. There is a working implementation here:
You need control of the page you are opening. If you do, you can pass data back into your app either using the popupBridge methods, or by using window.postMessage.
If you need a cordova-android 7+ version, I have modified it here: