Fix: Don't set management server ID if cookie isn't set.#13404
Conversation
|
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@sureshanaparti , please merge at will. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13404 +/- ##
============================================
- Coverage 17.67% 17.67% -0.01%
+ Complexity 15792 15791 -1
============================================
Files 5922 5922
Lines 533167 533169 +2
Branches 65210 65210
============================================
- Hits 94246 94241 -5
- Misses 428276 428281 +5
- Partials 10645 10647 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I can confirm this fixes the issue for us too! |
|
Awesome work, congrats on your first merged pull request! |
|
This fixed worked, with a bit of improvising when applying from the front-end without recompiling. Not sure if this was the best approach, so if there is a better/proper way to do this, please share. edit the file /usr/share/cloudstack-management/webapp/js/app.e527f263.js Search ".commit("SET_MS_ID",N.a.get("managementserverid"))" and replace with ";const ms_id=N.a.get("managementserverid");ms_id&&v["a"].commit("SET_MS_ID",ms_id)" sudo service cloudstack-management restart That's it and SSO should work again. |
I can confirm this work around. If I remember correctly, the string to replace is
with
For additional reference you will have a line that looks like below after replacement
|
Description
This PR prevents the frontend from setting MS_ID if the "managementserverid" cookie isn't set.
We upgraded to 4.22.1.0 yesterday and non-root-admins couldn't log in with SAML, they were presented with a blank white page and some errors in the javascript console. After a little time in the debugger, I chased it down to this change setting MS_ID in localstorage to "undefined", causing downstream issues in
store/modules/user.js.Fixes: #13277
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Rebuilt the UI and swapped it in place live on our management server.
How did you try to break this feature and the system with this change?