ios - 谷歌 400 错误 : invalid request Custom scheme URIs are not allowed for 'Web' client type

标签 ios google-oauth uri-scheme

当我在我的 iOS 应用程序中登录 Gmail 时,出现以下错误(屏幕截图)并且没有显示登录字段。我们正在 WKWebView 中加载登录屏幕。

  • 我们正在使用自定义 URI 重定向,但为什么 Google 现在会抛出此错误。自定义 URI 有哪些替代方案?
  • Swift 2.3 项目
  • 使用 OAuthSwift v0.6.0 cocoapod
  • 这只是在过去一周左右才开始的,我相信 Google 的 API 发生了一些变化。

我读到谷歌正在弃用 OAuth 的 WebView ,并将在 2017 年 4 月 20 日阻止请求。如谷歌开发者博客中所示: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

这是否意味着我已经需要使用或者是否有其他可行的解决方案?我以为我有更多时间需要更新它。

enter image description here

最佳答案

我的猜测是您的客户端在 Google Cloud Console 中注册不正确。 “WEB”客户端通常是服务器或 Javascript 应用程序。 iOS 应用程序应注册为 iOS 客户端。

https://developers.google.com/identity/protocols/OAuth2InstalledApp#creatingcred

关于ios - 谷歌 400 错误 : invalid request Custom scheme URIs are not allowed for 'Web' client type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42269251/

相关文章:

ios - Xamarin Forms、MS Azure 崩溃,无法在 iOS 上运行

ios - 复制到剪贴板的图像在粘贴时被裁剪

javascript - 不为自托管 chrome 扩展的 chrome.identity.getAuthToken 调用回调

html - 在浏览器中检测 URI 方案支持

ios - Swift:为什么我的 UITextFieldDelegate 方法没有被调用?

ios - 使用 Swift 将新图像分配给 UIImageView

ruby-on-rails - YouTube 的 Google 身份验证在 Rails 中不起作用

php - 如何使用 Php cURL 中的简单上传将上传的文件移动到特定的驱动器文件夹?

http - 仅包含方案 + 路径的 URL 有效吗?

ios - Firebase 动态链接 : How to get the URI scheme from the dynamic link that gets generated?