1

I am integrating google drive files docs,spreadsheets and preasentations with my app. I need some help about alternate link.

Files.get api includes a link called "alternateLink" which opens users file with compatible editor. But when i forward user to link if user is not logged in, google shows login screen before. I am asking about how can i overcome with login screen using OAuth2 mechanizm. Should i set a cookie or smt else ?

Thanks

4

1 回答 1

3

AlternateLink 将始终要求用户登录其 Google 帐户。如果您想使用它,则必须公开共享该文档,此时不需要登录。

要使用 OAuth 2.0,您必须使用“downloadUrl”,您可以将 OAuth 2.0 访问令牌附加到 downloadUrl,如下所示:

authorizedDownloadUrl = downloadUrl + '&access_token=' + accessToken

请注意,下载 URL 将在 24 小时后过期。

于 2013-01-18T13:35:02.450 回答