Django user logout with remote authentication

I have a website that uses remote authentication through Kerberos. I installed everything according to the Django documentation ( https://docs.djangoproject.com/en/dev/howto/auth-remote-user/ ). Logging in works fine, but logging out does not end there. What can I do to completely log out the user? Closing the browser window fully works, but users should be able to log out without closing the browser window.

+5
source share
2 answers

When a user exits django, the django session is destroyed, but the user is still logged into Kerberos, and the next request automatically creates a new session. You cannot do anything in your django application. The user must exit Kerberos itself, because Kerberos can be used to authenticate the user in other services / applications at the same time.

0
source

Use HttpResponse to return 401 status.

def logout(request):
    return HttpResponse(content, status=401)

This will result in user registration from Kerebos.

Credit: I saw this solution elsewhere related to basic authentication.

0
source

All Articles