Does GoogleAccountCredential provide an update token?

I plan to write an Android application to extract files from Google Drive.

If the storage is huge, it will definitely take several hours to download the files. In this case, I need to update the token to complete the process. As far as I know, it GoogleAccountCredentialdoes not provide any methods for obtaining an update token.

I want to send a token and update the token to a website so that it uploads files on behalf of my application and stores it on the server.

Is there a way to get update tokens from GoogleAccountCredential?

+5
source share
2 answers

, java, , GoogleAuthorizationaflow .


flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport, jsonFactory, clientSecrets, SCOPES)             .setAccessType( "" ) setApprovalPrompt ( "" ) ();..

0

, . :

String MY_SCOPE = ""; // put your score here, e.g. "https://www.googleapis.com/auth/gmail.readonly"
String CLIENT_ID = "1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com";
String SERVER_SCOPE = "oauth2:server:client_id:" + CLIENT_ID + ":api_scope:" + MY_SCOPE;

GoogleAccountCredential cred = new GoogleAccountCredential(context, SERVER_SCOPE).setSelectedAccountName("hello@gmail.com");
cred.getToken();
0

All Articles