【问题标题】:Google Picker not using OAuth tokenGoogle Picker 不使用 OAuth 令牌
【发布时间】:2013-12-25 05:41:12
【问题描述】:

Google Picker 似乎没有使用我们传递给显示的 OAuth 令牌。它始终使用用户浏览器上第一个登录的帐户。

我目前正在使用类似这样的方式构建选择器:

google_identity = { accessToken: 'oauth token', appId: '12345678',
                    email: 'example@example.com' };
picker = new google.picker.PickerBuilder().
             addView(google.picker.ViewId.DOCUMENTS).
             enableFeature(google.picker.Feature.MULTISELECT_ENABLED).
             enableFeature(google.picker.Feature.NAV_HIDDEN).
             setAppId(google_identity.appId).
             setOAuthToken(google_identity.accessToken).
             setCallback(pickerCallback).
             build();
picker.setVisible(true);

我错过了什么吗?我使用的 App ID 是一串数字(这似乎是文档所暗示的),我很确定我的 OAuth 令牌可以访问 Google Drive,因为我在应用程序的其他地方使用令牌来操作 Google 上的文件驾驶。我还在构建选择器之前刷新了 OAuth 令牌,所以令牌肯定是最新的。

我目前正在使用的一种解决方法是拨打.setAuthUser(google_identity.email),但这并不理想。

【问题讨论】:

    标签: javascript google-oauth google-picker


    【解决方案1】:

    这个问题显然已经被 Google 解决了。它现在按预期工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-29
      • 2017-06-09
      • 1970-01-01
      • 2015-06-27
      • 2012-04-05
      • 2013-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多