Preventing automatic sign-in when using Google+ Sign-In

Update The best supported way to prevent automatic sign-in is to use the API method gapi.auth2.getAuthInstance().signOut() which will prevent automatic sign-in on your site after it has been called. Demo here. In the demo, the user is signed out when they leave the page as shown in the following code: window.onbeforeunload = function(e){ gapi.auth2.getAuthInstance().signOut(); }; … Read more

Android Google+ integration – repeated UserRecoverableAuthException

I’ve had this issue for a while and came up with a proper solution. String token = GoogleAuthUtil.getToken(this, accountName, scopeString, appActivities); This line will either return the one time token or will trigger the UserRecoverableAuthException. On the Google Plus Sign In guide, it says to open the proper recovery activity. startActivityForResult(e.getIntent(), RECOVERABLE_REQUEST_CODE); When the activity … Read more

Retrieving a user’s public google/gmail picture

Is very easy http://picasaweb.google.com/data/entry/api/user/<hereYourUserIdOrYourEmail>?alt=json just has a little problem. You only can get the picture of your Google+ profile, not directly from your gmail. UPDATE: This API is being deprecated and will be turned down in January 2019. Migrate to Google Photos Library API as soon as possible to avoid disruptions to your application. More … Read more

Google API: getting Credentials from refresh token with oauth2client.client

I use: oauth2client.client.GoogleCredentials cred = oauth2client.client.GoogleCredentials(access_token,client_id,client_secret, refresh_token,expires_at,”https://accounts.google.com/o/oauth2/token”,some_user_agent) http = cred.authorize(httplib2.Http()) cred.refresh(http) self.gmail_service = discovery.build(‘gmail’, ‘v1’, credentials=cred)

Google OAuth API to get user’s email address?

Update: December 2018 On December 20th, Google announced that the Google+ API would be turned down in March 2019, with intermittent failure starting at the end of January 2019. As part of the the plus.people.get endpoint is deprecated and scheduled to be terminated. The userinfo endpoint is de-deprecated (see clarification) and should provide the info … Read more