有很多关于这个问题的 StackOverflow 帖子,但没有一个提供网络应用程序通过谷歌网络身份验证在嵌入式浏览器(如 iOS 上的 Facebook/Facebook Messenger)中登录服务的解决方法;但我发现使用 Google 按钮登录 Pinterest 的网络似乎可以正常工作,所以我想知道是否有人知道他们是如何使其工作的。
Google disallowed logging into Google from webviews几年前,还有Auth0 also made a blog post about workarounds ,但这一切似乎都集中在 native 应用程序上,而不是提供 Google 作为登录选项的网络应用程序。
但是我公司的应用程序是一个网络应用程序,如果有人在 Facebook Messenger/Facebook 帖子上分享到我们网站的链接,即使用户没有弹出原生 Safari 浏览器,也可以使用 Google 登录.根据上述文档,这似乎是不可能的 - 但实际上我发现 Pinterest 的“使用 Google 登录”按钮确实有效!因此,似乎有一种方法可以让 Google 登录正常工作(不确定他们是否与 Google 达成了特殊协议(protocol),或者他们是否正在做我们/Auth0 也可以做的事情)。
复现步骤:
https://community.auth0.com
的消息并证明似乎确实有一种方法可以在野外完成:
https://pinterest.com
的消息任何人都知道这里发生了什么?
此问题已 cross-posted to Auth0's support community forum ,因为我的团队通过 Auth0 实现了 Google Auth,但它似乎通常与 Auth0 相关。
编辑:查看 Google OAuth 端点 URL 我的站点与 Pinterest 的更多详细信息:
查看我的网站与 Pinterest 使用的 Google oauth URL,我看到了一些不同之处:
https://accounts.google.com/o/oauth2/auth
, 他们的转至 https://accounts.google.com/o/oauth2/auth/identifier
["openid.realm", ""]
["ss_domain", "https://www.pinterest.com"]
["fetch_basic_profile", "true"]
["gsiwebsdk", "2"]
["flowName", "GeneralOAuthFlow"]
response_type
的值不同的 permission id_token
, 我的是 code
不知道会产生什么影响。
编辑:this StackOverflow post from several months ago 中的相同问题但没有事件,和 this one from 4 years ago但他们声称没有办法——这似乎不是真的,因为 Pinterest 能够成功!同时 Spotify 和 StackOverflow 也因此错误而失败。可能是内幕交易...
最佳答案
403: disallowed user_agent
是因为您的组织不允许使用该资源。 2017 年,谷歌实际上改变了帐户的身份验证方式。
您可以从我的来源阅读更多信息:Google Login: Error 403: This user-agent is not permitted to make an OAuth authorization request to Google as it is classified as an embedded user-agent (disallowed_useragent)
关于authentication - Web Google 身份验证 - 403 : disallowed_useragent exists? 的解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65353812/