Fix for Tenancy info getting lost on re-login in SAML Authentication flow#1058
Conversation
5389ca1 to
cc85354
Compare
public/apps/account/utils.tsx
Outdated
public/apps/account/utils.tsx
Outdated
|
@peternied I have created the Integration Tests using selenium to catch this bug. It is added in the same PR 1044 raised by @devardee Upon confirmation of the new ITs, can we merge this PR separately as only this fix needs to be back-ported to other older versions as well which might not have the support for the ITs. |
We have already made an exception for the 2.2 release, lets keep the quality of this branch high by not adding more changes until the tests have been merged. I haven't seen any questions comments on that PR is any help needed? |
That's great, thanks for making these. However, we would like to merge the tests with the change. I understand there is interest in backporting this change and which is a great reason to be sure that this change functions correctly with the tests side by side in all the versions its applied to. |
Codecov Report
@@ Coverage Diff @@
## main #1058 +/- ##
==========================================
+ Coverage 72.43% 74.39% +1.96%
==========================================
Files 88 86 -2
Lines 1919 1871 -48
Branches 246 241 -5
==========================================
+ Hits 1390 1392 +2
+ Misses 474 424 -50
Partials 55 55
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Does this bug affect oidc as well?
We recently discovered that session timeout also had the same bug where setShouldShowTenantPopup(null) was not getting called. See #1090
There was a problem hiding this comment.
Didn't test this for OIDC
|
@peternied Now that the integration tests are ready to be merged, please review this PR as well. |
|
#1088 still hasn't been merged as its CI is failing, until that change has been merged and this change has been rebased to include the tests (+the test for the new functionality) we won't be able to merge this pull request. Almost there! |
|
This was closed automatically when #1088 was merged. Re-opening this PR. |
270284b to
b35e7af
Compare
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…separate PR Signed-off-by: Aniketh Jain <anijainc@amazon.com>
b35e7af to
9678b22
Compare
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
|
@cwperks @peternied The prerequisite test are failing as the artefacts for security plugin v2.4.0 is not getting downloaded. This was last changed in a version increment PR How can we resolve this issue ? |
|
@anijain-Amazon It looks like there's a build issue with Link to distribution build output: https://build.ci.opensearch.org/job/distribution-build-opensearch/6082/console |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-1058-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 05649d6f517bd22e27694060e60dbe9f9b8c9ba6
# Push it to GitHub
git push --set-upstream origin backport/backport-1058-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3Then, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1058-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 05649d6f517bd22e27694060e60dbe9f9b8c9ba6
# Push it to GitHub
git push --set-upstream origin backport/backport-1058-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.xThen, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-1058-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 05649d6f517bd22e27694060e60dbe9f9b8c9ba6
# Push it to GitHub
git push --set-upstream origin backport/backport-1058-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2Then, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.0 1.0
# Navigate to the new working tree
cd .worktrees/backport-1.0
# Create a new branch
git switch --create backport/backport-1058-to-1.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 05649d6f517bd22e27694060e60dbe9f9b8c9ba6
# Push it to GitHub
git push --set-upstream origin backport/backport-1058-to-1.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.0Then, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.1 1.1
# Navigate to the new working tree
cd .worktrees/backport-1.1
# Create a new branch
git switch --create backport/backport-1058-to-1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 05649d6f517bd22e27694060e60dbe9f9b8c9ba6
# Push it to GitHub
git push --set-upstream origin backport/backport-1058-to-1.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.1Then, create a pull request where the |
|
@anijain-Amazon The backport-bot failed to create the backport PRs. These will need to be created manually for each branch that this should be backported to. |
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6) Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6) Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
* Fix for Tenancy info getting lost on re-login in SAML Authentication flow (#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6) * Incremented patch version to match OSD Signed-off-by: Aniketh Jain <anijainc@amazon.com> Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6) Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…flow (opensearch-project#1058) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
* Fix for Tenancy info getting lost on re-login in SAML Authentication flow (#1058) Signed-off-by: Aniketh Jain <anijainc@amazon.com>
* Fix for Tenancy info getting lost on re-login in SAML Authentication flow #1058 * SAML Integration Tests #1088 * Preserve URL Hash for SAML based login #1054 Signed-off-by: Aniketh Jain <anijainc@amazon.com> Signed-off-by: Deepak Devarakonda <devardee@amazon.com> Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com> Co-authored-by: Deepak Devarakonda <devardee@amazon.com> Co-authored-by: Deepak Devarakonda <80896069+devardee@users.noreply.github.com> (cherry picked from commit a9d10d8) (cherry picked from commit a4fa35d) (cherry picked from commit 05649d6)
…Authentication flow (opensearch-project#1058) (opensearch-project#1125) * Fix for picking up tenancy from local storage in SAML AuthN flow Signed-off-by: Aniketh Jain <anijainc@amazon.com> (cherry picked from commit 05649d6)
Description
This fix is for ensuring that tenancy information is read from the local storage in SAML Authentication workflow after a user log out of OS Dashboard.
Category
Bug Fix
Why these changes are required?
To have a good user experience and ensure their tenancy is reloaded after logging in into a new session in the same browser.
What is the old behavior before changes and new behavior after changes?
Tenancy information was not being read from local storage after logout in old behaviour for SAML authentication enabled domains. After the changes, tenancy information will be read from local storage. This is ensured as the session storage variable
pendistro::security::tenant::show_popupis set to null after logout in SAML Authentication workflow.Issues Resolved
Issue created for this bug
Testing
The changes have been made in security-dashboards-plugin and the same has been tested for OS Dashboards in SAML authentication enabled domains.
AfterFix_SAMLTenancyBug.mp4
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.