将Google+专OAuth的停机影响到我,如果我的代码是不可见的参考Google+吗?

问题描述 投票:4回答:1

Google+的API关机 - 我已经警告我说,我的谷歌应用程序脚本项目将通过他们来(2019年3月7日2019年1月28日)受到影响收到一封邮件来自谷歌。

你好Google+开发,

下面的电子邮件包含您最近的Google+的API的使用。注意:它包括Google+的OAuth的范围请求,这也受到了Google+关机。发送到主动API调用者的现有邮件不包括有关的OAuth请求的信息。最后一个提醒邮件将在二月份被发送到谁仍然有活跃的API或OAuth的请求活动用户。

我需要什么知道吗?在2019年3月7日,所有的Google+ API和Google+登录将被彻底关闭。这将是一个渐进的关机,以起步早,2019年1月28,间歇性地失败的API调用,并于Google+的OAuth请求范围开始,早在2019年2月15,间歇性地失败。

我需要做什么?由2019年3月7日请更新下面列出的项目,并确保他们不再使用Google+ API或Google+的请求OAuth范围。下面的数据显示哪些Google+ API方法您的项目最近呼吁,以及Google+的OAuth范围已要求。注意:如果你看到来电people.get,这些都可以在你的应用程序,这是现在完全停用,正在关闭使用Google+登入功能的结果。开发人员应该从Google+的迁移登录功能,以更全面的谷歌登录身份验证系统。

电子邮件是明确的关于我的项目故障,并提供以下位置的详细信息:

Project...............:My_GAS_Project_Name  
Google+ API Name......:OAuth    
Version...............:N/A
Method or OAuth Scope.:plus.me

但我认为这是一个假阳性。

我使用OAuth的API,但不是Google+的API。我已经关注以下字符串;在“加”“+”我的代码,并没有发现任何地方引用*。

*是有“+”的无处不在,但他们每个人都记为一个字符串连接操作。

这是在项目中的OAuth功能:

function _getAuthenticationToken_() {
  // Check we have access to the service
  var service = getService();
  if (!service.hasAccess()) {
    var authorizationUrl = service.getAuthorizationUrl();
    _log_('INFO', 'Open the following URL and re-run the script: ' + authorizationUrl);
    return;
  }

  Logger.log('Passed Authentication');

  //Get the Access Token
  return service.getAccessToken();

  function getService() {
    // Create a new service with the given name. The name will be used when
    // persisting the authorized token, so ensure it is unique within the
    // scope of the property store.
    return OAuth2.createService('jlr-edw-dev-service')

    // Set the endpoint URLs, which are the same for all Google services.
    .setAuthorizationBaseUrl('https://accounts.google.com/o/oauth2/auth')
    .setTokenUrl('https://accounts.google.com/o/oauth2/token')

    // Set the client ID and secret, from the Google Developers Console.
    .setClientId(CLIENT_ID)
    .setClientSecret(CLIENT_SECRET)

    // Set the name of the callback function in the script referenced
    // above that should be invoked to complete the OAuth flow.
    .setCallbackFunction('authCallback')

    // Set the property store where authorized tokens should be persisted.
    .setPropertyStore(PropertiesService.getUserProperties())

    // Set the scopes to request (space-separated for Google services).
    // this is admin access for the sqlservice and access to the cloud-platform:
    .setScope(
      'https://www.googleapis.com/auth/sqlservice.admin ' + 
      'https://www.googleapis.com/auth/cloud-platform')

    //Removed because this Should be covered by cloud-platform
    //'https://www.googleapis.com/auth/devstorage.read_write ' 

    // Below are Google-specific OAuth2 parameters.

    // Sets the login hint, which will prevent the account chooser screen
    // from being shown to users logged in with multiple accounts.
    .setParam('login_hint', Session.getActiveUser().getEmail())

    // Requests offline access.
    .setParam('access_type', 'offline')

    // Forces the approval prompt every time. This is useful for testing,
    // but not desirable in a production application.
    .setParam('approval_prompt', 'force');
  }

  function authCallback(request) {
    var cloudSQLService = getService();
    var isAuthorized = cloudSQLService.handleCallback(request);

    if (isAuthorized) {
      _log_('INFO', 'Access Approved');
      return HtmlService.createHtmlOutput('Success! You can close this tab.');
    } else {
      _log_('INFO', 'Access Denied');
      return HtmlService.createHtmlOutput('Denied. You can close this tab');
    }
  }
}

我应该忽略来自谷歌的警告,或者是有什么事我可以检查,以确认这些项目不会有风险?

我要补充一点的项目都通过谷歌应用程序脚本执行API暴露和它们的功能正在通过Java program based on the the Google example执行。只有以这种方式访问​​的项目已被标记。

更多细节响应DaImTo的评论补充。

唯一的图书馆项目资源打开是的OAuth:enter image description here

借助Google+ API和人民API都处于关闭状态:enter image description here

该项目的API信息中心并不包括Google+中:enter image description here

UPDATE

我想我可能知道现在发生了什么。下图说明的组件。 enter image description here

1)这些是从用于执行谷歌应用程序脚本的Java程序中提取的范围。它们包括的范围“https://www.googleapis.com/auth/userinfo.email”。

2)这是Google OAuth2 API, v2范围文档。

3)这是授予谷歌应用程序脚本项目的范围。基于它看起来像“plus.me”已被列入,即描述性的名称“知道你是在谷歌= https://www.googleapis.com/auth/plus.me谁”。

所以,由于某种原因,同时要求获得“https://www.googleapis.com/auth/userinfo.email”的要求扩大到包括“https://www.googleapis.com/auth/plus.me”。我觉得这发生威力,因为“serinfo.email”已被弃用,described here

enter image description here

解决

从谷歌进一步的沟通澄清说,它的确是一个假阳性和无需更改代码。

尊敬的开发,

本周早些时候,我们送您与您的项目将由Google+的API关机,这也影响了Google+的OAuth范围请求受到影响的电子邮件。

电子邮件中列出的一个或多个的项目所请求的“plus.me”范围,并且将因此受到影响。我们想澄清,只有直接请求“plus.me”范围的项目受到影响。这个范围可能在一些电子邮件已经上市,即使不直接通过您的项目要求。我们对造成的任何不便,敬请见谅。

如果您直接请求“plus.me”范围,其他任何Google+ OAuth范围,或进行任何Google+的API调用,请确保您2019年3月7日之前从您的项目这些请求。

要看到,如果你的项目是直接请求“plus.me”或其他任何Google+ OAuth范围:

•如果你的项目是写在谷歌Apps脚本,您可以查看哪些作用域你的项目通过查看应用程序脚本编辑器项目属性请求。

•如果你的项目是不是在谷歌Apps脚本编写的,请检查你的代码的引用中的OAuth范围的请求“plus.me”。我们建议您使用支持登陆或社会功能的任何第三方库的审查项目,这些也可以通过关机影响。

感谢您成为一个有价值的Google+开发。

此致Google+ API团队

google-apps-script oauth-2.0 google-api google-plus google-oauth2
1个回答
2
投票

我想你应该在谷歌开发者控制台检查。请确保您没有启用项目中的谷歌+ API。这可能造成假阳性。

enter image description here

这就是我能想到的唯一的事情。即使这是一个代码问题谷歌并没有真正获得他们都不会去扫描每个脚本发出警告,一个开发人员的代码。

© www.soinside.com 2019 - 2024. All rights reserved.