pythonfacebookflaskoauthflask-oauthlib

Flask-OAuth TypeError: Unicode-objects must be encoded before hashing


I'm trying to use Flask-OAuth with Facebook following this example. I have define APP_ID and APP_SECRET according to mine.

I can login with facebook account now, but when it redirects after login, I got this error:

TypeError: Unicode-objects must be encoded before hashing

According to the example code if there are no edited, the line of error was on line 48

me = facebook.get('/me')

So, what's wrong with that..?


Solution

  • I have found the answers The flask_oauth library doesn't support Python3, instead I'm using Flask-OAuthlib.

    And instead of the example code that I use in the link above, now I'm using the new one in this example