1

I am trying to access google sheets using Java client Library. First time access token and refresh token are generated and stored in File.(StoredCredential). Once the access token expires new token is not generated with Refresh token. Please suggest what can be done.

Sample Code:

 GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH))) .setAccessType("offline") .build(); LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build(); return new AuthorizationCodeInstalledApp(flow, receiver).authorize("user"); 
1
  • Read the information here about using offline access. Commented Jul 29, 2020 at 8:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.