Google client doesn't work for google cloud?
I was trying to use this with Google oauth, but my project is in Google Cloud, and the user_info uri doesn't work for those for some reason. So I had to use a different URI and parsing.
I'm not exactly sure what what, but this is the client I ended up using:
class GoogleClient(OAuth2Client):
"""Support Google.
* Dashboard: https://console.developers.google.com/project
* Docs: https://developers.google.com/accounts/docs/OAuth2
* API reference: https://developers.google.com/gdata/docs/directory
* API explorer: https://developers.google.com/oauthplayground/
"""
access_token_url = 'https://accounts.google.com/o/oauth2/token'
authorize_url = 'https://accounts.google.com/o/oauth2/auth'
base_url = 'https://www.googleapis.com/plus/v1/'
name = 'google'
user_info_url = 'https://www.googleapis.com/userinfo/v2/me' # Different URI
@classmethod
def user_parse(cls, data) -> UserInfo: # Different format
"""Parse information from provider."""
return UserInfo(
id=data.get('sub', data.get('id')),
email=data.get('email'),
verified_email = data.get('verified_email'),
first_name=data.get('given_name'),
last_name=data.get('family_name'),
picture=data.get('picture'),
)