Created
October 16, 2017 13:29
-
-
Save salrashid123/5623eecf7869edf4a85a6fc8460104e6 to your computer and use it in GitHub Desktop.
Proxy-GoogleAPIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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