使用Google Picker无需登录Google帐户(使用OAuth) [英] Use Google Picker without logging in with Google account (with OAuth)

查看:141
本文介绍了使用Google Picker无需登录Google帐户(使用OAuth)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以向未与其登录的用户显示 Google Picker Google帐户?我想让用户从我网站的Google帐户的共享Google云端硬盘中选择文件.我可以使用服务器上的OAuth访问这些文件.但是也可以通过Google Picker呈现文件吗?也许使用这种方法:

Is it possible to present the Google Picker to a user who isn't logged in with her Google account? I would like to let the user select files from a shared Google Drive of the Google account of my website. I can access these files with OAuth on the server. But is it also possible to present the files with Google Picker? Maybe with this method:

PickerBuilder.setOAuthToken(string)

设置用于验证当前用户的OAuth令牌. 根据令牌的范围,将仅显示某些视图 数据.有效范围是Google文档,云端硬盘和照片.这个方法 用户通过身份验证时,应使用.setAuthUser代替 使用OAuth.

Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, and Photos. This method should be used instead of .setAuthUser when a user is authenticated with OAuth.

Google Picker API参考

我已经尝试过了,但我认为这是不可能的.是吗?

I have tried this and I think it is not possible. Or is it?

推荐答案

此API方法确实有效(我目前正在使用).请注意,来自Google的身份验证令牌已过期,您可能需要刷新令牌,否则Google选取器在尝试从Google驱动器检索文件列表时将返回401.

This method of the API does work (I use it currently). Just note that the auth token from google expires and you may need to refresh your token otherwise the google picker will return a 401 when trying to retrieve the list of files from google drive.

PickerBuilder.setOAuthToken(string)

这篇关于使用Google Picker无需登录Google帐户(使用OAuth)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆