Firebase Oauth在第三方应用程序的Web视图上禁止用户代理 [英] Firebase Oauth disallowed user agent on third party app's web view
问题描述
因此,我做了一些搜索,发现Google已经通过Web视图弃用了OAuth身份验证。以下是 LINK 。
所以我的问题是:
如果检测到Web视图,是否可以强制用户打开正常的浏览器?
或者有什么办法可以解决这个问题?
我正在使用Firebase身份验证。我的所有代码都使用Firebase SDK进行身份验证firebase-auth.js和firebase.js) 解决方案
和iframes,它允许safari webkit.if你用safari用户代理覆盖用户代理,那么它将工作。
试试这个,一旦它可以正常工作
webView.getSettings()。setUserAgentString(Mozilla / 5.0(Windows NT 6.1 )AppleWebKit / 537.36(KHTML,像Gecko)Chrome / 41.0.2228.0 Safari / 537.36);
I am having trouble with OAuth authentication. The thing is the OAuth authentication works properly on normal browser, but it doesn't work on third party app's web view such as LINE or Facebook's Messenger. What happen is on third party app's web view, when user click "sign in with google", for instant, Google will show error page 403 error: "disallowed_useragent". (This happens when I try to send the link to my web application to my friend via the Messenger. When my friend click on the link, Messenger open my web application on their web view. My friend won't be able to click sign in then)
Therefore, I do some searches and found out that Google has deprecated OAuth authentication via the web view. Here is the LINK.
So my questions is: Is it possible to force user to open normal browser if web view is detected? Or are there some ways to work around with this?
I am using Firebase authentication for this. All of my codes use Firebase SDK for authentication firebase-auth.js and firebase.js)
Google restricts the authentication from webviews and iframes,it allowes safari webkit.if you override user agent with safari user agent then it will works. try this once it will works
webView.getSettings().setUserAgentString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
这篇关于Firebase Oauth在第三方应用程序的Web视图上禁止用户代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!