rdmorganiser / rdmorganiser/rdmo
Django 5 compatibility bug in the logout flow (with Shibboleth)
- Dominant language
- Python
- Stars
- 133
- Forks
- 60
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 21
Description
Description / Beschreibung
with help of ChatGPT
With Shibboleth as the only authentication backend and
LOGOUT_URL = '/account/shibboleth/logout/'
the logout results in:
GET /account/shibboleth/logout/
-> 302 /account/logout/?next=/Shibboleth.sso/Logout
GET /account/logout/?next=/Shibboleth.sso/Logout
-> 405 Method Not Allowed
shibboleth_logout() currently redirects to account_logout, which resolves to Django's LogoutView when django-allauth is disabled.
Since Django 5, LogoutView no longer supports logout via GET and requires POST, so the redirect results in a 405 response.
Expected behaviour / Erwartetes Verhalten
RDMO should first terminate the local Django session and then redirect to SHIBBOLETH_LOGOUT_URL, e.g.:
POST /account/shibboleth/logout/
-> Django logout
-> 302 /Shibboleth.sso/Logout
A possible fix would be for shibboleth_logout() to call django.contrib.auth.logout() directly and then redirect to SHIBBOLETH_LOGOUT_URL. The logout action in the navigation should use a POST form instead of a GET link.
This may also affect non-allauth installations in general, since the navigation uses a link to /account/logout/ while Django's LogoutView is POST-only.
Context / Kontext
Please state your operating system, the RDMO version, and (if applicable) the browser the error occurred in.
References / Verweise
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.