0

I'm making a service that runs over flask and uses OAuth for authentication. My code is roughly same as things in this link. For now, I tried to request Google with scope 'email' as below:

def authorize(self):
        return redirect(self.service.get_authorize_url(
            scope = 'email',...

And then, I could get a response, the following is part of the response:

...u'name': u'', u'family_name': u'', u'email_verified': True, u'given_name': u''...

As you can see, names are just blank while I could get the email address as intended. So, I'd like to know if there's any workaround to get the email and the name(s) at the same time. Thank you in advance for your help. :-)

Community
  • 1
  • 1
laputan1
  • 1
  • 1

1 Answers1

0

You perhaps want the profile scope too; the email scope only fills in the email address.

What profiles are available is listed in the JSON API; besides email and profile, there is also the openid scope (which is, I believe, a default). Also see the Google Sign-in scopes.

However, the email scope should already include the full name of the user, provided they filled one in and are sharing it.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Thank you, Martjin. But, well, I could get names with some of my google accounts even I requested with 'email' only while rest of my accounts couldn't. – laputan1 May 19 '16 at 01:59
  • @laputan1: then those accounts don't want to give that info out or have not filled it in. – Martijn Pieters May 19 '16 at 06:26
  • @Martjin, actually, those accounts are also mine. I made them for testing.They are supposed to be okay... – laputan1 May 19 '16 at 07:17