From: Lenz Grimmer Date: Wed, 6 Feb 2019 18:57:27 +0000 (+0100) Subject: Merge pull request #26058 from rhcs-dashboard/37917-sso-404-page X-Git-Tag: v14.1.0~197 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=97c69cfe207975a2319a185b51d0d71a3e83d4a5;p=ceph.git Merge pull request #26058 from rhcs-dashboard/37917-sso-404-page mgr/dashboard: SSO - UserDoesNotExist page Reviewed-by: Kanika Murarka --- 97c69cfe207975a2319a185b51d0d71a3e83d4a5 diff --cc src/pybind/mgr/dashboard/controllers/saml2.py index 3c78c05bbf4,223521ee2de..51bda8e8d62 --- a/src/pybind/mgr/dashboard/controllers/saml2.py +++ b/src/pybind/mgr/dashboard/controllers/saml2.py @@@ -61,15 -63,14 +61,14 @@@ class Saml2(BaseController) 'SSO error - `{}` not found in auth attributes. ' 'Received attributes: {}' .format( - SSO_DB.saml2.get_username_attribute(), + mgr.SSO_DB.saml2.get_username_attribute(), auth.get_attributes())) username = username_attribute[0] + url_prefix = prepare_url_prefix(mgr.get_module_option('url_prefix', default='')) try: - ACCESS_CTRL_DB.get_user(username) + mgr.ACCESS_CTRL_DB.get_user(username) except UserDoesNotExist: - raise cherrypy.HTTPError(400, - 'SSO error - Username `{}` does not exist.' - .format(username)) + raise cherrypy.HTTPRedirect("{}/#/sso/404".format(url_prefix)) token = JwtManager.gen_token(username) JwtManager.set_user(JwtManager.decode_token(token))