Project

General

Profile

Actions

Bug #59689

closed

mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode'

Added by Volker Theile 12 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Security & Auth
Target version:
% Done:

0%

Source:
Development
Tags:
backport_processed
Backport:
pacific, quincy, reef
Regression:
No
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.


Related issues 3 (0 open3 closed)

Copied to Dashboard - Backport #61280: pacific: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode'ResolvedNizamudeen AActions
Copied to Dashboard - Backport #61281: reef: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode'ResolvedNizamudeen AActions
Copied to Dashboard - Backport #61282: quincy: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode'ResolvedNizamudeen AActions
Actions #1

Updated by Volker Theile 12 months ago

  • Description updated (diff)
Actions #2

Updated by Volker Theile 12 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 51406
Actions #3

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
Actions #4

Updated by Backport Bot 11 months ago

  • Copied to Backport #61280: pacific: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Actions #5

Updated by Backport Bot 11 months ago

  • Copied to Backport #61281: reef: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Actions #6

Updated by Backport Bot 11 months ago

  • Copied to Backport #61282: quincy: mgr/dashboard: SSO error: AttributeError: 'str' object has no attribute 'decode' added
Actions #7

Updated by Backport Bot 11 months ago

  • Tags set to backport_processed
Actions #8

Updated by Nizamudeen A 10 months ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF