Skip to content

Conversation

@Luis-3M
Copy link
Contributor

@Luis-3M Luis-3M commented Jun 14, 2022

Description

This PR fixes the issue #6427 -> SAML request must be appended to an IdP URL as a query param with an ampersand, if the URL already contains a question mark, as opposed to always assume that IdP URLs don't have any query params.
Google's IdP URL for instance looks like this: https://accounts.google.com/o/saml2/idp?idpid=<ID>, therefore the expected redirect URL would be https://accounts.google.com/o/saml2/idp?idpid=<ID>&SAMLRequest=<SAMLRequest>

This code change is backwards compatible with the current behaviour.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Successful request
saml_success

Unsuccessful request (due to a broken redirect URL)
saml_failure

How Has This Been Tested?

@boring-cyborg
Copy link

boring-cyborg bot commented Jun 14, 2022

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6457 (SL-JID-1730)

@Luis-3M Luis-3M mentioned this pull request Jun 14, 2022
12 tasks
@nvazquez nvazquez added this to the 4.17.1.0 milestone Jun 15, 2022
@nvazquez
Copy link
Contributor

@Luis-3M @neogismm it seems we have 2 PRs solving the same issue, can you work on unifying them? (#6451)

@Luis-3M
Copy link
Contributor Author

Luis-3M commented Jun 15, 2022

@nvazquez Yep happy to close mine if @neogismm keeps #6451 open 👍

@neogismm
Copy link

Hi @Luis-3M thanks for the PR. I was stuck on how to write the tests for the same and looking at your code helps me to learn.

@Luis-3M
Copy link
Contributor Author

Luis-3M commented Jun 16, 2022

No worries at all @neogismm - thank you.

@utchoang utchoang force-pushed the 4.17 branch 4 times, most recently from 4bf2f2b to 1b71696 Compare June 16, 2022 11:01
@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

1 similar comment
@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6457 (SL-JID-1798)

@Luis-3M
Copy link
Contributor Author

Luis-3M commented Jun 21, 2022

@nvazquez we will keep this one open.

@blueorangutan
Copy link

UI build: ✖️
(SL-JID-2)

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@Luis-3M Luis-3M requested a review from DaanHoogland June 23, 2022 11:31
@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6457 (SL-JID-1868)

@harikrishna-patnala
Copy link
Contributor

@Luis-3M Code LGTM. If you can please address one code smell as suggested by Daan, that will look pefect.

@Luis-3M
Copy link
Contributor Author

Luis-3M commented Jul 5, 2022

Thanks for your input @DaanHoogland @harikrishna-patnala .
Suggested changes have been addressed.

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6457 (SL-JID-1904)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 5, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a 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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3711

@DaanHoogland
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-4430)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40694 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6457-t4430-kvm-centos7.zip
Smoke tests completed. 97 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_disable_oobm_ha_state_ineligible Error 1511.69 test_hostha_kvm.py

@yadvr yadvr merged commit c6b6114 into apache:4.17 Jul 6, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 6, 2022

Awesome work, congrats on your first merged pull request!

shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Mar 13, 2023
* Add EncryptedElementType key resolver to SAML plugin

* saml: Fix SAML SSO plugin redirect URL (apache#6457)

This PR fixes the issue apache#6427 -> SAML request must be appended to an IdP URL as a query param with an ampersand, if the URL already contains a question mark, as opposed to always assume that IdP URLs don't have any query params.
Google's IdP URL for instance looks like this: https://accounts.google.com/o/saml2/idp?idpid=<ID>, therefore the expected redirect URL would be https://accounts.google.com/o/saml2/idp?idpid=<ID>&SAMLRequest=<SAMLRequest>

This code change is backwards compatible with the current behaviour.

* Apply backport for SAML session cookie path

apache#6149

* ui: Logout before login (apache#6193)

This PR calls the logout API before login, to cleanup any duplicate sessionkey, as it was done on the legacy UI: apache#4326
Fixes: apache#6127

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Luis Moreira <Luis-3M@users.noreply.github.com>
Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants