Use Google Picker without logging in with Google account (with OAuth)

送分小仙女□ 提交于 2019-12-21 19:10:49

问题


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)

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 reference

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


回答1:


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)


来源:https://stackoverflow.com/questions/13413150/use-google-picker-without-logging-in-with-google-account-with-oauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!