Error trying to disconnect using social-auth-app-django

2

Good afternoon guys,

I am building an application in Django, where it is necessary for the user to authenticate through his Microsoft account, for this, I am using the social-auth-app-django / strong>.

Authentication is occurring normally, but I am not able to get the user to disconnect from the application.

Settings.py

AUTHENTICATION_BACKENDS = (
    'social_core.backends.azuread.AzureADOAuth2',
    'django.contrib.auth.backends.ModelBackend',
    )


SOCIAL_AUTH_AZUREAD_OAUTH2_RESOURCE = 'https://graph.microsoft.com/'
SOCIAL_AUTH_LOGIN_ERROR_URL = 'login'
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
SOCIAL_AUTH_RAISE_EXCEPTIONS = False
LOGIN_URL = '/login'
LOGOUT_URL = '/login'
URL_LOGIN = '/login/'


SOCIAL_AUTH_DISCONNECT_PIPELINE = (
    'social_core.pipeline.social_auth.social_details',
    'social_core.pipeline.social_auth.social_uid',
    'social_core.pipeline.social_auth.auth_allowed',
    'social_core.pipeline.social_auth.social_user',
    'social_core.pipeline.social_auth.associate_user',
    'social_core.pipeline.social_auth.load_extra_data',
    'social_core.pipeline.user.user_details',
    'social_core.pipeline.disconnect.allowed_to_disconnect',
    'social_core.pipeline.disconnect.get_entries',
    'social_core.pipeline.disconnect.revoke_tokens',
    'social_core.pipeline.disconnect.disconnect',
)

URLs.py

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('webapp.core.urls',               namespace='core')),
    ...
    url(r'^login/$', auth_views.login,                  name='login'),
    url(r'^logout/$', auth_views.logout,                name='logout'),
    url(r'^oauth/', include('social_django.urls',       namespace='social')),
    ]

I'm trying to disconnect via POST using CSRF

<form action="{% url 'social:disconnect' 'azuread-oauth2' %}{{ user.id }}/?next=/login" method="post">
        {% csrf_token %}
        <button class="btn btn-warning btn-xs">
            Disconnect
        </button>
    </form>

I get the following error:

TypeError at /oauth/disconnect/azuread-oauth2/1/
social_details() missing 1 required positional argument: 'response'
Request Method: POST
Request URL:    http://localhost:8000/oauth/disconnect/azuread-oauth2/1/?next=/login
Django Version: 1.11.4
Exception Type: TypeError
Exception Value:    
social_details() missing 1 required positional argument: 'response'
Exception Location: D:\virtualenv\venv_hercules\lib\site-packages\social_core\backends\base.py in run_pipeline, line 113
Python Executable:  D:\virtualenv\venv_hercules\Scripts\python.exe
Python Version: 3.5.2
    
asked by anonymous 29.05.2018 / 23:55

0 answers