Giter Site home page Giter Site logo

Comments (9)

theacodes avatar theacodes commented on July 19, 2024

Hi @essramos! That log statement should be logging.info(session)

from getting-started-python.

essramos avatar essramos commented on July 19, 2024

Hi @jonparrott, I figured it was logging.info(session), I tried that, and there is no "profile" key from the session.

from getting-started-python.

essramos avatar essramos commented on July 19, 2024

here is the detail of the session. I just left some of the keys blank.

{
  "google_oauth2_credentials": {
    "token_response": {
      "expires_in": 3600,
      "id_token": "",
      "token_type" : "Bearer",
      "access_token": ""
    },
    "scopes": [
      "profile",
      "email"
    ],
    "_class": "OAuth2Credentials",
    "revoke_uri": "https://accounts.google.com/o/oauth2/revoke",
    "token_info_uri": "https://www.googleapis.com/oauth2/v3/toke\r\nninfo",
    "token_uri": "https://www.googleapis.com/oauth2/v4/token",
    "refresh_token": null,
    "invalid": false,
    "id_token": {
      "azp": "",
      "exp": 1497581985,
      "email": "",
      "sub": "113869672794459914014",
      "at_hash": "",
      "iat": 1497578385,
      "picture": "https://lh4.googleusercontent.com/-sdrufhE2XEA/AAAAAAAAAAI/AAAAAAAAAGI/v9s7xTQwoxw/s96-c/photo.jpg",
      "given_name": "Ella Sh\r\nerilyn",
      "aud": "",
      "name": "Ella Sherilyn Ramos",
      "iss": "https://accounts.google.com",
      "family_name": "Ramos",
      "locale": "en",
      "email_verified": true
    },
    "user_agent": null,
    "client_secret": "",
    "access_token": "",
    "token_expiry": "2017-06-16T02:59:45Z",
    "_modu\r\nle": "oauth2client.client",
    "client_id": ""
  },
  "google_oauth2_csrf_token": ""
}

from getting-started-python.

theacodes avatar theacodes commented on July 19, 2024

@essramos just to be sure, can you add a logging statement to _request_user_info to log out the session at the end of the function and see if profile is in there?

I also think this is the might same issue that @waprin and I observed a while back - the session is becoming too large to fit into a cookie, so chrome is ignoring the cookie.

from getting-started-python.

essramos avatar essramos commented on July 19, 2024

Hi @jonparrott , by logging out the session on _request_user_info you mean I should call the end point '/logout'?

from getting-started-python.

essramos avatar essramos commented on July 19, 2024

This error came up as well :

ERROR in __init__: Error while obtaining user profile: {'transfer-encoding': 'chunked', 'date': 'Tue, 20 Jun 2017 03:11:32 GMT', 'content
-length': '963', 'x-content-type-options': 'nosniff', 'x-frame-options': 'SAMEORIGIN', 'expires': 'Tue, 20 Jun 2017 03:11:32 GMT', 'server': 'GSE', 'x-xss-protection': '1; mode=block', 'status': '403', '-conte
nt-encoding': 'gzip', 'content-type': 'application/json; charset=UTF-8', 'cache-control': 'private, max-age=0', 'vary': 'Origin, X-Origin'}

from getting-started-python.

theacodes avatar theacodes commented on July 19, 2024

Interesting - a 403 means we made an unauthenticated request. Can you try logging credentials.__dict__ as well? Please elide the access and refresh tokens.

from getting-started-python.

essramos avatar essramos commented on July 19, 2024

On _request_user_info, I tried to print the content instead of resp when catching the error. This is what I got.

ERROR in __init__: Error while obtaining user profile: b'{\n "error": {\n  "errors": [\n   {\n    "domain": "usageLimits",\n    "reason": "accessNotConfigured",\n    "messa
ge": "Access Not Configured. Google+ API has not been used in project 732114750463 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/plus.googleapis.com/overview?project=732114750463 then retry. If y
ou enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",\n    "extendedHelp": "https://console.developers.google.com/apis/api/plus.googleapis.com/overview?project=732114750463"\n   }\n  ],\n  "cod
e": 403,\n  "message": "Access Not Configured. Google+ API has not been used in project 732114750463 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/plus.googleapis.com/overview?project=73211475046
3 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."\n }\n}\n'

And it worked after I enabled the API. Probably a good idea to also print out the content when status is no 200

Thanks for all the help!

from getting-started-python.

theacodes avatar theacodes commented on July 19, 2024

@essramos great suggestion. Thanks for being patient and walking through all the debugging steps.

from getting-started-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.