python from oauthlib.oauth2 import BackendApplicationClient from requests_oauthlib import OAuth2Session client_id = 'your-client-id' client_secret = 'your-client-secret' scope = ['profile', 'email'] client = BackendApplicationClient(client_id=client_id) oauth = OAuth2Session(client=client) token = oauth.fetch_token(token_url='https://accounts.google.com/o/oauth2/token', client_id=client_id, client_secret=client_secret, scope=scope) response = oauth.get('https://www.googleapis.com/oauth2/v1/userinfo') print(response.json())


上一篇:
下一篇:
切换中文