summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/saml2.py
diff options
context:
space:
mode:
authorLenz Grimmer <lenz@grimmer.com>2019-02-06 19:57:27 +0100
committerGitHub <noreply@github.com>2019-02-06 19:57:27 +0100
commit97c69cfe207975a2319a185b51d0d71a3e83d4a5 (patch)
tree231f561877714f93e07d01a57c5e73accdd94820 /src/pybind/mgr/dashboard/controllers/saml2.py
parentMerge pull request #26290 from dzafman/wip-38027-38195 (diff)
parentmgr/dashboard: SSO - UserDoesNotExist page (diff)
downloadceph-97c69cfe207975a2319a185b51d0d71a3e83d4a5.tar.xz
ceph-97c69cfe207975a2319a185b51d0d71a3e83d4a5.zip
Merge pull request #26058 from rhcs-dashboard/37917-sso-404-page
mgr/dashboard: SSO - UserDoesNotExist page Reviewed-by: Kanika Murarka <kmurarka@redhat.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/controllers/saml2.py')
-rw-r--r--src/pybind/mgr/dashboard/controllers/saml2.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/saml2.py b/src/pybind/mgr/dashboard/controllers/saml2.py
index 3c78c05bbf4..51bda8e8d62 100644
--- a/src/pybind/mgr/dashboard/controllers/saml2.py
+++ b/src/pybind/mgr/dashboard/controllers/saml2.py
@@ -64,18 +64,16 @@ class Saml2(BaseController):
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:
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))
token = token.decode('utf-8')
logger.debug("JWT Token: %s", token)
- url_prefix = prepare_url_prefix(mgr.get_module_option('url_prefix', default=''))
raise cherrypy.HTTPRedirect("{}/#/login?access_token={}".format(url_prefix, token))
else:
return {