Skip to content

Commit 5944da8

Browse files
authored
Merge pull request ceph#62296 from afreen23/wip-sso-fix
mgr/dashboard: fix OAuth2 SSO when roles_path is empty Reviewed-by: Pedro Gonzalez Gomez <[email protected]>
2 parents d4ce7b6 + 737ae7f commit 5944da8

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)