GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, scopes)
.setCredentialStore(credentialStore).build();
// TODO change this to remove the port
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder()
.setPort(5555).build();
// Authorize.
return new AuthorizationCodeInstalledApp(flow, localReceiver)
.authorize("user");