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)

How to get user email from google plus oauth

Set your scopes to: https://www.googleapis.com/auth/userinfo.email and https://www.googleapis.com/auth/userinfo.profile And use the endpoint: https://www.googleapis.com/oauth2/v1/userinfo?alt=json Usage: get https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=youraccess_token You will get JSON: { “id”: “xx”, “name”: “xx”, “given_name”: “xx”, “family_name”: “xx”, “link”: “xx”, “picture”: “xx”, “gender”: “xx”, “locale”: “xx” }

tech