How to handle popup in webviewer needed for authentication to access a website

1,260 views
Skip to first unread message

Hayder Hussein

unread,
Nov 4, 2017, 1:04:34 AM11/4/17
to MIT App Inventor Forum
Hi,

I have a website that I want to access in webviewer shows a popup when clicked on login. It uses OAuth authentication.

In a normal browser the popup will be closed after successful login and returning to the original site.

The popup window is receiving the OAuth code response and runs a javascript to pass the OAuth code and clientid to the original window as JSON data.

Is there any way to handle popups in webviewer?

Currently with one webviewer the flow of this authentication reaches to loading the popup window in the webviewer, however it will not be able close itself and go back to the original window.opener, since the original window.opener have already gone when the popup loaded in this very same webviewer, and hence it shows blank screen.

If no way to handle the popup, is there any other trick to use one webviewer and when the authentication code received in the blank screen, parsing the html source code and use that data to login when loading the original website again?

I have been trying to get any solution for the past few days with no luck. Any help is appreciated..

Hayder Hussein

unread,
Nov 4, 2017, 1:19:36 AM11/4/17
to MIT App Inventor Forum
I am novice in Java, but I found this Java example how to do it :
https://stackoverflow.com/questions/12648099/making-facebook-login-work-with-an-android-webview
Reply all
Reply to author
Forward
0 new messages