User logout problem with django-cas-ng

119 views
Skip to first unread message

Fabrice Pardo

unread,
Oct 3, 2017, 8:02:33 AM10/3/17
to django CMS developers
Hi,

I use both django.contrib.auth.backends.ModelBackend and django_cas_ng.backends.CASBackend as authentication backends,
for two different targets:
- ModelBackend for superusers, which are not knowns from CASBackend
- CASBackend for all other authentication usages

I have added these lines to urls.py
    url(r'^accounts/login/$', django_cas_ng.views.login, name='login'),
    url(r'^accounts/logout/$', django_cas_ng.views.logout, name='logout'),

1) Login problem: How can I redirect to accounts/login/ a page ending with /?edit suffix?
Please note that I want to keep ModelBackend for admin/ pages
Well, this question is only to satisfy my curiosity because I have introduced a middelware forcing CASBackend for all pages except admin/ and accounts/
and users are already authentified when they want to edit a page.

2) Logout problem is more serious: How can I ask "User Logout" menu defined in cms_toolbars.py to redirect towards accounts/logout/ instead of admin/logout/ ?
Please note that I want to keep admin/logout/ if I am authentified through admin/login.

Thanks

-- 
Fabrice

Fabrice Pardo

unread,
Oct 3, 2017, 8:21:45 AM10/3/17
to django CMS developers
Well, in fact I do need to call first admin/logout/ in the two cases.
My problem is to call accounts/logout/ after that, if the authentication was done through CASBackend.
Reply all
Reply to author
Forward
0 new messages