mirror of https://github.com/jumpserver/jumpserver
fix(authentication): 修复cas退出的bug
parent
501329a8db
commit
832bb832ce
|
@ -202,4 +202,6 @@ class SSOAuthentication(ModelBackend):
|
||||||
"""
|
"""
|
||||||
什么也不做呀😺
|
什么也不做呀😺
|
||||||
"""
|
"""
|
||||||
pass
|
|
||||||
|
def authenticate(self, request, sso_token=None, **kwargs):
|
||||||
|
pass
|
||||||
|
|
|
@ -17,6 +17,7 @@ from django.views.generic.base import TemplateView, RedirectView
|
||||||
from django.views.generic.edit import FormView
|
from django.views.generic.edit import FormView
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
|
from django.contrib.auth import BACKEND_SESSION_KEY
|
||||||
|
|
||||||
from common.const.front_urls import TICKET_DETAIL
|
from common.const.front_urls import TICKET_DETAIL
|
||||||
from common.utils import get_request_ip, get_object_or_none
|
from common.utils import get_request_ip, get_object_or_none
|
||||||
|
@ -205,12 +206,12 @@ class UserLoginWaitConfirmView(TemplateView):
|
||||||
class UserLogoutView(TemplateView):
|
class UserLogoutView(TemplateView):
|
||||||
template_name = 'flash_message_standalone.html'
|
template_name = 'flash_message_standalone.html'
|
||||||
|
|
||||||
@staticmethod
|
def get_backend_logout_url(self):
|
||||||
def get_backend_logout_url():
|
backend = self.request.session.get(BACKEND_SESSION_KEY, '')
|
||||||
if settings.AUTH_OPENID:
|
if 'OIDC' in backend:
|
||||||
return settings.AUTH_OPENID_AUTH_LOGOUT_URL_NAME
|
return settings.AUTH_OPENID_AUTH_LOGOUT_URL_NAME
|
||||||
# if settings.AUTH_CAS:
|
elif 'CAS' in backend:
|
||||||
# return settings.CAS_LOGOUT_URL_NAME
|
return settings.CAS_LOGOUT_URL_NAME
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
|
|
|
@ -90,6 +90,7 @@ CAS_LOGIN_URL_NAME = "authentication:cas:cas-login"
|
||||||
CAS_LOGOUT_URL_NAME = "authentication:cas:cas-logout"
|
CAS_LOGOUT_URL_NAME = "authentication:cas:cas-logout"
|
||||||
CAS_LOGIN_MSG = None
|
CAS_LOGIN_MSG = None
|
||||||
CAS_LOGGED_MSG = None
|
CAS_LOGGED_MSG = None
|
||||||
|
CAS_IGNORE_REFERER = True
|
||||||
CAS_LOGOUT_COMPLETELY = CONFIG.CAS_LOGOUT_COMPLETELY
|
CAS_LOGOUT_COMPLETELY = CONFIG.CAS_LOGOUT_COMPLETELY
|
||||||
CAS_VERSION = CONFIG.CAS_VERSION
|
CAS_VERSION = CONFIG.CAS_VERSION
|
||||||
CAS_ROOT_PROXIED_AS = CONFIG.CAS_ROOT_PROXIED_AS
|
CAS_ROOT_PROXIED_AS = CONFIG.CAS_ROOT_PROXIED_AS
|
||||||
|
|
Loading…
Reference in New Issue