[Django]-Django-Allauth Facebook integration – Ask for permission to post to User's wall separately

3👍

I finally solved it. Turns out that django allauth saves the settings as JSON in the DOM element #allauth-facebook-settings. You just have to modify this json and pass to the allauth facebook init function. When the user clicks to enable a feature which requires ‘publish_actions’ permission, I call a Javascript function:

function modify_permissions() {
    var json = JSON.parse($("#allauth-facebook-settings").html());
    json["loginOptions"]["scope"] = "email, publish_actions";
    allauth.facebook.init(json);
}

Now, if you try to connect a FB account from that page, django allauth will ask for ‘publish_actions’ permission too.

👤Amit

0👍

In the SOCIALACCOUNT_PROVIDER setting provided by django allauth http://django-allauth.readthedocs.io/en/latest/providers.html#facebook You would need to change the following section to include any extra permission you need


SOCIALACCOUNT_PROVIDERS = {
'facebook': {
'SCOPE': ['email', 'public_profile', 'publish_actions'], # add your permissions here
'METHOD': 'js_sdk',
...
}
}

👤gbozee

Leave a comment