GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
HTTP_TRANSPORT, JSON_FACTORY, clientSecrets,
Collections.singleton(PredictionScopes.PREDICTION))
.setCredentialStore(credentialStore).build();
// authorize
return new AuthorizationCodeInstalledApp(flow,
new LocalServerReceiver()).authorize("user");
}