Skip to content

Commit 737ae7f

Browse files
committed
mgr/dashboard: fix OAuth2 SSO when roles_path is empty
Fixes https://tracker.ceph.com/issues/70454 Due to PR linter updates, this place remained not updated hence failing Signed-off-by: Afreen Misbah <[email protected]>
1 parent d143a1a commit 737ae7f

File tree

1 file changed

+1
-1
lines changed
  • src/pybind/mgr/dashboard/services/auth

1 file changed

+1
-1
lines changed

src/pybind/mgr/dashboard/services/auth/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_user_roles(cls):
9393
except AttributeError:
9494
raise cherrypy.HTTPError(401)
9595

96-
if jmespath and hasattr(mgr.SSO_DB.config, 'roles_path'):
96+
if jmespath and getattr(mgr.SSO_DB.config, 'roles_path', None):
9797
logger.debug("Using 'roles_path' to fetch roles")
9898
roles = jmespath.search(mgr.SSO_DB.config.roles_path, jwt_payload)
9999
# e.g Keycloak

0 commit comments

Comments
 (0)