Bug #59689
closedmgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode'
0%
Description
When SSO is enabled, with PyJWT >= 2 and python3, login via SSO fails with:
Internal Server Error
Traceback (most recent call last):
File "/usr/share/ceph/mgr/dashboard/services/exception.py", line 47, in dashboard_exception_handler
return handler(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in call
return self.callable(*self.args, **self.kwargs)
File "/usr/share/ceph/mgr/dashboard/controllers/_base_controller.py", line 267, in inner
ret = func(*args, **kwargs)
File "/usr/share/ceph/mgr/dashboard/controllers/saml2.py", line 73, in auth_response
token = token.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
This is because tokens in PyJWT are already str objects. To fix this the token.decode line in controllers/saml2.py is adapted to match the form used in controllers/auth.py to avoid this error.
Updated by Volker Theile 12 months ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 51406
Updated by Nizamudeen A 11 months ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from pacific, quincy to pacific, quincy, reef
Updated by Backport Bot 11 months ago
- Copied to Backport #61280: pacific: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Updated by Backport Bot 11 months ago
- Copied to Backport #61281: reef: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Updated by Backport Bot 11 months ago
- Copied to Backport #61282: quincy: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Updated by Nizamudeen A 10 months ago
- Status changed from Pending Backport to Resolved