pennersr/django-allauth — pull request #761 by arctelix (2014-11-11 09:17:38+00:00)
Title: added dynamic scope features

I believe this will resolve #381. I implemented the strategy you mentioned as follows:

1) added process='redirect'
2) added new GET param scope="comma separated list of additional scope items".
3) client.scope and is populated with provider.get_dynamic_scope(request) which combines get_scope() and the dynamically added scope.
4) scope is added to SocialLogin.state (only new scope).
5) When process='redirect' the origin path is automatically set as the next param.
6) After authorization _add_social_account & _complete_social_login are bypassed and _social_login_redirect is used. This provides a hook adapter.pre_social_login_redirect and sends signals.pre_social_login_redirect before redirecting.
7) Finally when redirected, the origin path is used unless next was explicitly declared or if SOCIAL_LOGIN_REDIRECT_URL is set to something other than "/".
8) There is also DYNAMIC_SCOPE_REDIRECT_URL which will replace SOCIAL_LOGIN_REDIRECT_URL when scope is used.

Let me know if you have any comments or suggestions.

I have begun work on a new open source project django-allauth-socialconnector to integrate many common social network tasks with the existing allauth infrastructure and feature request #381 is required. This will greatly reduce the need for third party api's when using allauth. It would work something like this:

In a template:

Post to the apps feed `{% post 'provider' item %}` or to all social accounts `{% post 'all' item %}`
Post to a users feed `{% post 'provider' item user %}` or to all social accounts `{% post 'all' item %}`

In a view:

connector = SocialConnector()
#post item all app feeds
connector.post(provider='all', item=item)
#post item all user feeds
connector.post(provider='all', item=item, user=user)