Javascript Google Picker未使用OAuth令牌
Google Picker似乎没有使用我们传递给display的OAuth令牌。它始终使用用户浏览器上的第一个登录帐户 我目前正在使用以下内容构建选择器:Javascript Google Picker未使用OAuth令牌,javascript,google-oauth,google-picker,Javascript,Google Oauth,Google Picker,Google Picker似乎没有使用我们传递给display的OAuth令牌。它始终使用用户浏览器上的第一个登录帐户 我目前正在使用以下内容构建选择器: google_identity = { accessToken: 'oauth token', appId: '12345678', email: 'example@example.com' }; picker = new google.picker.PickerBuilder().
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);
我错过什么了吗?我使用的应用程序ID是一个数字字符串(这似乎是文档所暗示的),我非常确定我的OAuth令牌可以访问Google Drive,因为我在应用程序的其他地方使用令牌来操作Google Drive上的文件。在构建选择器之前,我还刷新了OAuth令牌,因此该令牌肯定是最新的
我目前使用的一种解决方法是使用
.setAuthUser(google\u identity.email)
呼叫,但这并不理想。谷歌显然已经解决了这个问题。它现在的工作情况和预期的一样