Originally published on my blog .
Google and Facebook block sign-in inside WebViews, and our Cordova app had been stuck on it for two years. The fix: sign in in the real browser, then come back to the app through a link.
The problem
The mobile apps I worked on were built with Cordova, so each app is a web page running inside a WebView. Google and Facebook sign-in used to work there, until both providers changed their rules and it stopped working. The bug was two years old, several attempts had failed, and one of our biggest clients made fixing it a condition of renewing.
Why it happens
Sign-in inside the WebView worked fine at first. Then Google and Facebook restricted SSO to the normal browser only, and blocked it inside WebViews. They did it on purpose: the app that hosts a WebView can read everything typed into it, including a password.…