Mohammed H
Mohammed H

Reputation: 7048

Acces Token management in Google Drive api for Javascript

My application using JavaScript to connect to get access the Google drive API.(see https://developers.google.com/drive/quickstart-js). First time it ask the user permission. At the time Google may give *access_token* to my application. I want to use the token to access the Google drive data in future(That time the user may not be sign-in in Google account). Is it possible? if possible how to do? Is it possible to the application to ask Google "please I want to get permission of the user [email protected]"? It will be useful at the time of multiple-signing

EDIT: Exactly my question is "Offline access is possible in JavaScript-API?" See It is possible in PHP-API: https://developers.google.com/accounts/docs/OAuth2WebServer#offline

Upvotes: 1

Views: 1329

Answers (1)

Claudio Cherubino
Claudio Cherubino

Reputation: 15024

The JavaScript API uses the OAuth 2.0 Client flow which only returns an access token. If you set approval_prompt=auto in your request URL, the consent page for a given set of scopes will only be shown the first time the user goes through the sequence, so he will not have to grant access to your app again:

https://developers.google.com/accounts/docs/OAuth2UserAgent

Upvotes: 1

Related Questions