]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #26058 from rhcs-dashboard/37917-sso-404-page
authorLenz Grimmer <lenz@grimmer.com>
Wed, 6 Feb 2019 18:57:27 +0000 (19:57 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Feb 2019 18:57:27 +0000 (19:57 +0100)
mgr/dashboard: SSO - UserDoesNotExist page

Reviewed-by: Kanika Murarka <kmurarka@redhat.com>
1  2 
src/pybind/mgr/dashboard/controllers/saml2.py
src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts
src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf

index 3c78c05bbf43091bb5791e92a4423b9504cbd683,223521ee2de5ed76522424d0e2d938c9a64dc917..51bda8e8d62d09e31338b395bdab4e7148a56fb4
@@@ -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))