Thanks to visit codestin.com
Credit goes to github.com

Skip to content

4.19 fix saml account selector #10311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 14, 2025

Conversation

rg9975
Copy link
Contributor

@rg9975 rg9975 commented Jan 31, 2025

Description

Fix issues with SAML multi-account selector in UI and various SAML2 plugin limitations.

  • Reliable account switch when selecting a new account/domain combination from UI
  • New global property (saml2.require.password) to disable password authentication requirement (this enables delegation to the SAML IDP to allow other forms of authentication like 2FA, mobile device, security key, etc). Default to true to match previous hard-coded behavior.
  • New global property (user.allow.multiple.accounts) to allow the same username to exist on multiple accounts in the same domain. Defaults to false to match previous behavior. Also this ONLY applies to SAML2 plugin at this time as other account types do not have an implementation for multi-account selection.
  • Update to use value of saml2.user.sessionkey.path (when set) on all session identity cookies during SAML2 session setup to simplify use across a reverse proxy.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Setup domain using SAML2 IDP (Azure Entra specifically) and performed validations of existing behaviors (single username only in a domain; password auth requirement), as well as tested ability to add multiple accounts for the same username in a domain and authentication with 2FA/device authentication.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some style remarks but code seems generally good

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12317

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 72.61905% with 23 lines in your changes missing coverage. Please review.

Project coverage is 15.17%. Comparing base (a09c579) to head (9ed57b5).
Report is 29 commits behind head on 4.19.

Files with missing lines Patch % Lines
...c/main/java/com/cloud/user/AccountManagerImpl.java 72.41% 7 Missing and 1 partial ⚠️
...stack/api/command/ListAndSwitchSAMLAccountCmd.java 50.00% 5 Missing ⚠️
...ain/java/org/apache/cloudstack/saml/SAMLUtils.java 86.84% 2 Missing and 3 partials ⚠️
server/src/main/java/com/cloud/api/ApiServer.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10311      +/-   ##
============================================
+ Coverage     15.15%   15.17%   +0.01%     
- Complexity    11315    11333      +18     
============================================
  Files          5413     5414       +1     
  Lines        474709   474856     +147     
  Branches      57894    57917      +23     
============================================
+ Hits          71940    72042     +102     
- Misses       394723   394758      +35     
- Partials       8046     8056      +10     
Flag Coverage Δ
uitests 4.28% <ø> (-0.01%) ⬇️
unittests 15.89% <72.61%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rohityadavcloud
Copy link
Member

@rg9975 can you check and address build failures on the PR branch.

I'll kick it again just in case.

@blueorangutan package

@blueorangutan
Copy link

@rohityadavcloud a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12406

@DaanHoogland DaanHoogland modified the milestones: 4.19.3, 4.19.2 Feb 11, 2025
@DaanHoogland
Copy link
Contributor

@rg9975 there is a unit test failure. Can you look at this?

@DaanHoogland DaanHoogland modified the milestones: 4.19.2, 4.19.3 Feb 11, 2025
@apache apache deleted a comment from blueorangutan Feb 17, 2025
@apache apache deleted a comment from blueorangutan Feb 17, 2025
@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-12444)

@Pearl1594
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12481)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 46002 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10311-t12481-kvm-ol8.zip
Smoke tests completed. 132 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_create_pvlan_network Error 0.09 test_pvlan.py

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm, some improvements in style possible.

@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@rohityadavcloud a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12608

@DaanHoogland
Copy link
Contributor

@rg9975 , can you look at 05:50:07 [ERROR] /jenkins/workspace/acs-centos8-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.19.3.0-SNAPSHOT/server/src/test/java/com/cloud/user/AccountManagerImplTest.java:19:15: Unused import - org.junit.Assert.assertThrows. [UnusedImports]

@Pearl1594 Pearl1594 moved this to In Progress in ACS 4.20.1 Mar 17, 2025
@kiranchavala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13038

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested the followig

  1. Reliable account switch when selecting a new account/domain combination from UI

The switching of the saml account is smooth, the issue reported before is also fixed

#10003
#10047

Screenshot 2025-04-14 at 4 22 34 PM

  1. New global property (saml2.require.password) to disable password authentication requirement (this enables delegation to the SAML IDP to allow other forms of authentication like 2FA, mobile device, security key, etc). Default to true to match previous hard-coded behavior.

Screenshot 2025-04-14 at 4 25 20 PM

Kiran> Tested the global setting

  1. New global property (user.allow.multiple.accounts) to allow the same username to exist on multiple accounts in the same domain. Defaults to false to match previous behavior. Also this ONLY applies to SAML2 plugin at this time as other account types do not have an implementation for multi-account selection.

Kiran> We can have multiple users with same username in multiple accounts in the same domain

Screenshot 2025-04-14 at 4 14 26 PM

Screenshot 2025-04-14 at 4 25 44 PM

@DaanHoogland DaanHoogland merged commit f13cf59 into apache:4.19 Apr 14, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ACS 4.20.1 Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants