diff options
author | Avan Thakkar <athakkar@redhat.com> | 2020-11-26 09:36:10 +0100 |
---|---|---|
committer | Avan Thakkar <athakkar@redhat.com> | 2020-12-01 07:44:38 +0100 |
commit | 5d65089469f2afff07ca13261a85849215570fc0 (patch) | |
tree | ad8d0e66e21297b65e863ba548d13f27365894a3 /src/pybind/mgr/dashboard/controllers/saml2.py | |
parent | Merge pull request #38274 from dillaman/wip-github-labeler-rbd (diff) | |
download | ceph-5d65089469f2afff07ca13261a85849215570fc0.tar.xz ceph-5d65089469f2afff07ca13261a85849215570fc0.zip |
mgr/dashboard: SSO not working after REST API versioning
Fixes: https://tracker.ceph.com/issues/48362
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
saml2: Fix versioning parameter for saml2 endpoints, including minor fix for
endpoints with xml=true
Diffstat (limited to 'src/pybind/mgr/dashboard/controllers/saml2.py')
-rw-r--r-- | src/pybind/mgr/dashboard/controllers/saml2.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/saml2.py b/src/pybind/mgr/dashboard/controllers/saml2.py index f53c7f0e1f6..76a7e193a9a 100644 --- a/src/pybind/mgr/dashboard/controllers/saml2.py +++ b/src/pybind/mgr/dashboard/controllers/saml2.py @@ -16,7 +16,7 @@ from .. import mgr from ..exceptions import UserDoesNotExist from ..services.auth import JwtManager from ..tools import prepare_url_prefix -from . import BaseController, Controller, Endpoint +from . import BaseController, Controller, Endpoint, allow_empty_body @Controller('/auth/saml2', secure=False) @@ -42,7 +42,8 @@ class Saml2(BaseController): except OneLogin_Saml2_Error: raise cherrypy.HTTPError(400, 'Single Sign-On is not configured.') - @Endpoint('POST', path="") + @Endpoint('POST', path="", version=None) + @allow_empty_body def auth_response(self, **kwargs): Saml2._check_python_saml() req = Saml2._build_req(self._request, kwargs) @@ -78,27 +79,27 @@ class Saml2(BaseController): 'reason': auth.get_last_error_reason() } - @Endpoint(xml=True) + @Endpoint(xml=True, version=None) def metadata(self): Saml2._check_python_saml() saml_settings = OneLogin_Saml2_Settings(mgr.SSO_DB.saml2.onelogin_settings) return saml_settings.get_sp_metadata() - @Endpoint(json_response=False) + @Endpoint(json_response=False, version=None) def login(self): Saml2._check_python_saml() req = Saml2._build_req(self._request, {}) auth = OneLogin_Saml2_Auth(req, mgr.SSO_DB.saml2.onelogin_settings) raise cherrypy.HTTPRedirect(auth.login()) - @Endpoint(json_response=False) + @Endpoint(json_response=False, version=None) def slo(self): Saml2._check_python_saml() req = Saml2._build_req(self._request, {}) auth = OneLogin_Saml2_Auth(req, mgr.SSO_DB.saml2.onelogin_settings) raise cherrypy.HTTPRedirect(auth.logout()) - @Endpoint(json_response=False) + @Endpoint(json_response=False, version=None) def logout(self, **kwargs): # pylint: disable=unused-argument Saml2._check_python_saml() |