pythonfacebook-graph-apioauthflaskrauth

getting the facebook access token from url in flask


I am writing an app using flask. I am using the RAuth module for OAuth. The url encoded access token that facebook is returning is formatted like www.myurl.com/authCallback#access_token=<token>.

I tried getting the raw string of the url using 'request.url', but that only returns www.myurl.com/authCallback

I also tried using a decoration of @app.route('/authCallback/<access_token>') which gives me a 404.

Is there a way to do this. Has anyone used these to libraries together before?


Solution

  • Why not take a look at the Flask example? Here's the callback view that handles parsing the code out of the URL.

    I would recommend following that example if you can. Hope that helps!