Skip to content

Instantly share code, notes, and snippets.

@salrashid123
Created October 16, 2017 13:29
Show Gist options
  • Save salrashid123/5623eecf7869edf4a85a6fc8460104e6 to your computer and use it in GitHub Desktop.
Save salrashid123/5623eecf7869edf4a85a6fc8460104e6 to your computer and use it in GitHub Desktop.
Proxy-GoogleAPIs
com.google.api.client.googleapis.auth.oauth2.GoogleCredential credential = com.google.api.client.googleapis.auth.oauth2.GoogleCredential.getApplicationDefault(mHttpTransport,jsonFactory);
if (credential.createScopedRequired())
credential = credential.createScoped(Arrays.asList(StorageScopes.DEVSTORAGE_READ_ONLY));
com.google.api.services.storage.Storage service = new com.google.api.services.storage.Storage.Builder(mHttpTransport, jsonFactory, credential)
.setApplicationName("oauth client")
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment