sns-sdks / python-facebook

A simple Python wrapper for facebook graph api :sparkles: :cake: :sparkles: .
https://sns-sdks.github.io/python-facebook/
322 stars 84 forks source link

Empty authorization page #243

Open ludovicchabant opened 9 months ago

ludovicchabant commented 9 months ago

Hello,

I'm trying to get some access tokens for an app that would access and manage a Facebook page, but I can't seem to get anywhere. The flow goes a bit like this:

perms = ['page_show_list', 'page_manage_posts']
return_url = 'https://mydomain.com/blah'
auth_client = GraphAPI(app_id, app_secret, oauth_flow=True)
login_url, state = auth_client.get_authorization_url(return_url, perms)

This generates a login URL like:

https://www.facebook.com/dialog/oauth?response_type=code&client_id=<ID>&redirect_uri=<RETURN_URL>&scope=pages_show_list+pages_manage_posts&state=PyFacebook

That leads to a page that is simply blank. My return URL doesn't seem to get accessed according to the server logs. That URL is of course added to the allowed app domains in my app's Meta dashboard. What's wrong?

DilanTsasi commented 7 months ago

Adding your URL to allowed domains is not enough, ensure that you have added it to valid OAuth redirect URLs in Client OAuth settings: https://developers.facebook.com/docs/facebook-login/guides/advanced/manual-flow/#login