问题
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