Google will no longer allow OAuth requests to Google in embedded browsers

时间:2017-04-10 02:39:23

标签: ios objective-c google-drive-api google-oauth google-oauth2

"On April 20, 2017, we will start blocking OAuth requests using web-views for all OAuth clients on platforms where viable alternatives exist."

We received this notice. In our iOS app using the Google drive, but google drive sdk no updated. google drive sdk still uses the old way. We need to modify the authorization method?

1 个答案:

答案 0 :(得分:1)

如果您使用WebView进行Google OAuth身份验证(例如,如果用户必须在WebView中键入Gmail地址和密码),是的,您必须更新它。

您有两种选择。

  1. SFSafariViewController:在SFSafariViewController而不是WebView中加载Google登录网址。如果您正在访问WebView中的任何cookie,则无法在SFSafariViewController中执行此操作。对于不支持SFSafariViewController的iOS 8及更低版本,您可以通过打开Safari浏览器进行身份验证来进行回退。

  2. Google Sign In SDK:使用Google登录iOS SDK。您在应用中添加了Google登录按钮,然后使用Google API进行身份验证。

  3. 有关详细信息,请参阅Google开发人员的演示文稿:https://docs.google.com/presentation/d/1z7bgAqYcEt7EHRmwe3T-vF_iMw9e8Wyxr10wPudypEo/present?slide=id.g135ae23358_0_71