I am using java library for oauth2 authentication for accessing google spreadsheet.
I am using below code for OAuth2 authentication:
credential = new
I use:
spreadsheetService = new SpreadsheetService("cellmaster.com.au-v0.2");
spreadsheetService.setHeader("Authorization", "Bearer " + accessToken);
rather than:
spreadsheetService = new SpreadsheetService("cellmaster.com.au-v0.2");
spreadsheetService.setOAuth2Credentials(credential);
also I had to add code for the refresh token. As the access token soon expires. But the refresh token works as you would expect.