@@ -37,7 +37,7 @@ def _check_python_saml():
3737 if not python_saml_imported :
3838 raise cherrypy .HTTPError (400 , 'Required library not found: `python3-saml`' )
3939 try :
40- OneLogin_Saml2_Settings (mgr .SSO_DB .saml2 .onelogin_settings )
40+ OneLogin_Saml2_Settings (mgr .SSO_DB .config .onelogin_settings )
4141 except OneLogin_Saml2_Error :
4242 raise cherrypy .HTTPError (400 , 'Single Sign-On is not configured.' )
4343
@@ -46,19 +46,19 @@ def _check_python_saml():
4646 def auth_response (self , ** kwargs ):
4747 Saml2 ._check_python_saml ()
4848 req = Saml2 ._build_req (self ._request , kwargs )
49- auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .saml2 .onelogin_settings )
49+ auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .config .onelogin_settings )
5050 auth .process_response ()
5151 errors = auth .get_errors ()
5252
5353 if auth .is_authenticated ():
5454 JwtManager .reset_user ()
55- username_attribute = auth .get_attribute (mgr .SSO_DB .saml2 .get_username_attribute ())
55+ username_attribute = auth .get_attribute (mgr .SSO_DB .config .get_username_attribute ())
5656 if username_attribute is None :
5757 raise cherrypy .HTTPError (400 ,
5858 'SSO error - `{}` not found in auth attributes. '
5959 'Received attributes: {}'
6060 .format (
61- mgr .SSO_DB .saml2 .get_username_attribute (),
61+ mgr .SSO_DB .config .get_username_attribute (),
6262 auth .get_attributes ()))
6363 username = username_attribute [0 ]
6464 url_prefix = prepare_url_prefix (mgr .get_module_option ('url_prefix' , default = '' ))
@@ -85,29 +85,29 @@ def auth_response(self, **kwargs):
8585 @Endpoint (xml = True , version = None )
8686 def metadata (self ):
8787 Saml2 ._check_python_saml ()
88- saml_settings = OneLogin_Saml2_Settings (mgr .SSO_DB .saml2 .onelogin_settings )
88+ saml_settings = OneLogin_Saml2_Settings (mgr .SSO_DB .config .onelogin_settings )
8989 return saml_settings .get_sp_metadata ()
9090
9191 @Endpoint (json_response = False , version = None )
9292 def login (self ):
9393 Saml2 ._check_python_saml ()
9494 req = Saml2 ._build_req (self ._request , {})
95- auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .saml2 .onelogin_settings )
95+ auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .config .onelogin_settings )
9696 raise cherrypy .HTTPRedirect (auth .login ())
9797
9898 @Endpoint (json_response = False , version = None )
9999 def slo (self ):
100100 Saml2 ._check_python_saml ()
101101 req = Saml2 ._build_req (self ._request , {})
102- auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .saml2 .onelogin_settings )
102+ auth = OneLogin_Saml2_Auth (req , mgr .SSO_DB .config .onelogin_settings )
103103 raise cherrypy .HTTPRedirect (auth .logout ())
104104
105105 @Endpoint (json_response = False , version = None )
106106 def logout (self , ** kwargs ):
107107 # pylint: disable=unused-argument
108108 Saml2 ._check_python_saml ()
109109 JwtManager .reset_user ()
110- token = JwtManager .get_token_from_header ( )
110+ token = JwtManager .get_token ( cherrypy . request )
111111 self ._delete_token_cookie (token )
112112 url_prefix = prepare_url_prefix (mgr .get_module_option ('url_prefix' , default = '' ))
113113 raise cherrypy .HTTPRedirect ("{}/#/login" .format (url_prefix ))
0 commit comments