elShiaLabeouf opened a new issue, #6365:
URL: https://github.com/apache/cloudstack/issues/6365
##### ISSUE TYPE
* Bug Report
##### COMPONENT NAME
~~~
UI: SAML login
~~~
##### CLOUDSTACK VERSION
~~~
main branch
commit: f572c7ab74508366b3b2ccbb2c0e6eeaa872fd36
~~~
##### CONFIGURATION
SAML authentication activated
##### OS / ENVIRONMENT
Environment: development,
Docker + Docker-compose,
"cloudstack-simulator" container running on localhost:5050/,
Ruby on Rails server running on localhost:3000/ as custom IdP implemented
via the saml_idp gem.
##### SUMMARY
The user is being redirected to login form after a successful SAML SSO login.
##### STEPS TO REPRODUCE
After the IdP sends POST http://localhost:5050/client/api?command=samlSso ,
it receives a response header `set-cookie:
userid=063f7aef-f355-4e4e-85f3-dcbaef02bb84` from the Cloudstack:

The path in the header is not specified, so the cookie is being set to
"/client" Path:

Nevertheless the previously successful POST got a response with the 302
status and the response header `location: http://localhost:5050/`, so the
browser is redirected to that location, but instead of a dashboard we see the
login form again:

OK, now we open `localhost:5050/client/` in the browser and fix the "userid"
cookie Path to '/' manually:

Then refresh the `localhost:5050/` tab and voila:

My thoughts:
I'm aware that Cloudstack UI on production is run on `/client` path, so the
bug wouldn't reproduce there, but I'm convinced that we shouldn't implicitly
hardcode the cookie to the `/client` Path.
Instead I propose to explicitly set it to the `/` Path.
I'm creating a PR to fix this and get back to you shortly.
P.S. Thank you for the SAML authentication option - it's a very convenient
way to authorize users in Cloudstack!
##### EXPECTED RESULTS
~~~
The user is redirected to his Cloudstack dashboard
~~~
##### ACTUAL RESULTS
~~~
The user is shown the login form
~~~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]