From aeb87e357f4f2e051f65768aa49998b8e7b724d7 Mon Sep 17 00:00:00 2001 From: pedram shahsafi Date: Sun, 3 Mar 2019 13:06:17 +0330 Subject: [PATCH] oauthlib.oauth2 Error oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response. --- docs/examples/google.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/examples/google.rst b/docs/examples/google.rst index 012b029d..29df1fc9 100644 --- a/docs/examples/google.rst +++ b/docs/examples/google.rst @@ -13,7 +13,10 @@ a callback URL then you can try out the command line interactive example below. >>> client_id = '.apps.googleusercontent.com' >>> client_secret = '' >>> redirect_uri = 'https://your.registered/callback' - + + # just for development !!! + >>> os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' + >>> # OAuth endpoints given in the Google API documentation >>> authorization_base_url = "https://accounts.google.com/o/oauth2/v2/auth" >>> token_url = "https://www.googleapis.com/oauth2/v4/token" @@ -37,7 +40,7 @@ a callback URL then you can try out the command line interactive example below. >>> # Fetch the access token >>> google.fetch_token(token_url, client_secret=client_secret, - ... authorization_response=redirect_response) + ... code=redirect_response) >>> # Fetch a protected resource, i.e. user profile >>> r = google.get('https://www.googleapis.com/oauth2/v1/userinfo')