Posts

Showing posts with the label Google Authentication

Access Google Spreadsheet API Without Oauth Token

Answer : API key is not enough. You're trying to use spreadsheets.values.append which requires OAuth authorization: Authorization Requires one of the following OAuth scopes: https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/spreadsheets For more information, see the [Auth Guide](https://developers.google.com/identity/protocols/OAuth2). Note it says OAuth. You could use the format as below: https://docs.google.com/spreadsheets/d/{sheetID}/export?format=csv Make a URLConnection to this URL, after replacing the sheetID with your public sheet and read the csv file as you would normally do in your programming language of choice. Please note that this is only true for Readable Public Google spreadsheets, and is a bit of a hack when you don't necessarily need to do the Credentials jig and jive In my case I need to publish content from a Google Spreadsheet to a web page. My workaround consists in u...

'com.google.android.gms.common.api.GoogleApiClient' Is Deprecated

Answer : Yeah GoogleApiClient has been deprecated. As per the documentation: When you want to make a call to one of the Google APIs provided in the Google Play services library (such as Google Sign-in and Drive), you need to create an instance of one the API client objects, which are subclasses of GoogleApi Particularly for the authentication api, you now need to use GoogleSignInClient . // Configure sign-in to request the user's ID, email address, and basic // profile. ID and basic profile are included in DEFAULT_SIGN_IN. GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); // Build a GoogleSignInClient with the options specified by gso. mGoogleSignInClient = GoogleSignIn.getClient(this, gso); You may refer following documentations for more details: Integrating Google Sign-In into Your Android App Moving Past GoogleApiClient