I am trying to create a PHP web page that requires reading some data from a google spreadsheet in my domain (I am using Google Apps Free Edition).
The spreadsheet t
You can use the new provided oauth2 flow
//flow use httpTransport, clientSecrets, json factory and datastore factory
val flow = new GoogleAuthorizationCodeFlow
.Builder(httpTransport,JSON_FACTORY,clientSecrets,SCOPES)
.setDataStoreFactory(datastoreFactory)
.build()
// authorize
val credential=new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user")
and use it with your gdata service:
val service:SpreadsheetService=new SpreadsheetService("SpreadsheetIntegration")
service.setOAuth2Credentials(credential)
full example in scala: https://github.com/spaced/spreadsheet-oauth2-example