I’m trying to get my FBML canvas page to automatically prompt new app users for permission to publish_stream. Following Facebook’s documentation I tried using the required_permissions argument to require_login. That is, I tried to use the pyfacebook require_login decorator like this:
@facebook.require_login(required_permissions='publish_stream')
as in:
@decorator_from_middleware(FacebookMiddleware)
@facebook.require_login(required_permissions='publish_stream')
def canvas(request, template):
...
Requesting extended permissions in a pyfacebook-based Facebook iFrame app has been discussed. Requesting extended permissions in an FBML app too. My objective is to require extended permissions in an FBML app. Am I missing something or can anyone suggest a workaround?
Thanks.
Right,
pyfacebookdoes not yet supportrequired_permissionsforlogin, but you can call (or rather, redirect to)authorizemanually. I’ve just written the following decorator for my purposes:You may have to tweak the value of
nextas it is passed toget_ext_perm_url, but this should otherwise be fine (works for me). Usage example: