Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook SOCIAL_AUTH_FACEBOOK_SCOPE not working as expected #294

Closed
imns opened this issue Jun 10, 2014 · 8 comments
Closed

Facebook SOCIAL_AUTH_FACEBOOK_SCOPE not working as expected #294

imns opened this issue Jun 10, 2014 · 8 comments

Comments

@imns
Copy link

imns commented Jun 10, 2014

I have

SOCIAL_AUTH_SCOPE = SOCIAL_AUTH_FACEBOOK_SCOPE = [
    'email',
    'manage_pages',
    'publish_stream'
]

In my settings file, but Facebook always returns {"error":{"message":"(#200) The user hasn't authorized the application to perform this action","type":"OAuthException","code":200}} with a status code of 403 when I try to modify a page.

@omab
Copy link
Owner

omab commented Jun 14, 2014

What are you trying to modify? Could you show me the API endpoints you are using?

@imns
Copy link
Author

imns commented Jun 17, 2014

I am trying to post to a page. The endpoint is: POST /{page-id}/feed and I have verified that the page id is correct. I've also added publish_actions to my SOCIAL_AUTH_FACEBOOK_SCOPE list.

I am basing this off of this documentation: https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed#pubfields

No matter what I seem to do I still get a 403 response like I posted above.

@omab
Copy link
Owner

omab commented Jun 18, 2014

Are you trying to post in behalf of the user or the page?

@tleewu
Copy link

tleewu commented Jul 11, 2014

@omab is SOCIAL_AUTH_SCOPE more preferred than FACEBOOK_EXTENDED_PERMISSIONS and whatnot? because it seems like the social_auth tutorial did not even talk about SOCIAL_AUTH_SCOPE. If this is the case, how do you request information from SOCIAL_AUTH_SCOPE (like email or something) in the view function?

@omab
Copy link
Owner

omab commented Jul 11, 2014

SOCIAL_AUTH_SCOPE is a supported setting but shouldn't be used (and I would remove such option in the future). FACEBOOK_EXTENDED_PERMISSIONS is a context name passed to a template defined when using the FacebookAppOAuth2 backend, it's not a setting, but it will contain the value of SOCIAL_AUTH_FACEBOOK_APP_SCOPE.

In order to defined scopes, backend-related settings should be used, like SOCIAL_AUTH_FACEBOOK_SCOPE.

@tleewu
Copy link

tleewu commented Jul 11, 2014

@omab sorry, I actually meant SOCIAL_AUTH_FACEBOOK_SCOPE. Where can I see the things I can call for SOCIAL_AUTH_FACEBOOK_SCOPE? like email or user likes or photos? because I think the syntax for facebook scope is different from facebook_extended permissions?

@omab
Copy link
Owner

omab commented Jul 11, 2014

@tleewu, the docs about Facebook Scopes can be found here https://developers.facebook.com/docs/facebook-login/permissions/v2.0, there's a lot to dig in there and all depends on what you need for your project.

@omab omab closed this as completed Apr 4, 2015
@arahman17
Copy link

This do the expected result for me. Hope it helps...

SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
'locale': 'ru_RU',
'fields': 'id, name, email, age_range'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants