vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
80 stars 79 forks source link

Added necessary cookies to get valid ADFS endpoint for organization. #637

Open mnspodrska opened 8 months ago

mnspodrska commented 8 months ago

Closes #556.

@dataclouder @Didainius

vmwclabot commented 8 months ago

@mnspodrska, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 8 months ago

@mnspodrska, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 8 months ago

@mnspodrska, VMware has approved your signed contributor license agreement.

mnspodrska commented 8 months ago

Ok, I got my approval, now to comment :)

This is a small change to make SAML auth work, but I figured it was problematic to test. So we have a working test VCD 10.5 environment with ADFS login for provider portal (not the tenants) where terraform is for managing resources. I was trying to SAML auth working and got stuck with VCD sending redirects from /login/System/saml/login/alias/vcd to /adfs/services/trust/13/usernamemixed of the VCD address, not the auth server. Then I found #556 and I grabbed time to test what needs to be changed and where. Patched it, compiled samples/saml_auth_adfs and it worked. Then I tested compiling terraform-provider-vcd against this version of go-vcloud-director and now my SAML auth finally works in terraform.

Now, I am aware that you have big plans to change more things to use cloud-api, but until then, this fix would allow us to use SAML login in go-vcloud-director and terraform even before the whole rewrite.

Would you consider merging it soon so that soon to be released terraform provider for VCD catches it for the next release?

lvirbalas commented 8 months ago

Hello @mnspodrska ,

Thank you for your contribution. Sorry, but it's too late for the next release of the provider, as it is in the final pre-release stages now. Also, though this PR is a one-liner it requires extensive testing and a security review.

mnspodrska commented 8 months ago

Ok, please tell me if I can do anything else to help.

mnspodrska commented 7 months ago

Any update on this? Can you consider merging it?

zhenyatsk commented 4 months ago

any updates?

Didainius commented 3 weeks ago

Hello, One thing to check - is it fine I make some attempt to make this an optional configuration instead of being default one? The main reason is we're afraid to have side effects for someone who had it working like that

mnspodrska commented 3 weeks ago

Hi, If you need to do that to satisfy the form, do it, but the essence is that it simply does not work for anybody, so it is unlikely that there is anything to break even more than it is...

Didainius commented 3 weeks ago

Hi, If you need to do that to satisfy the form, do it, but the essence is that it simply does not work for anybody, so it is unlikely that there is anything to break even more than it is...

I know that at least 2 companies had it working (at least until recently)

mnspodrska commented 3 weeks ago

That is interesting to hear, and I understand your hesitation. I guess that those companies are not available for running tests, so making tech depth is in order. Please tell me if I can help somehow...

Didainius commented 3 weeks ago

I will look at the option to leave current behaviour as it is, but also add a way to customise this. Are you using only the SDK or is it Terraform as well?

mnspodrska commented 3 weeks ago

I use it primarly with terraform, but also with SDK

Didainius commented 2 weeks ago

I use it primarily with terraform, but also with SDK

I have made an attempt to give you the customisation option but retain original behaviour (mainly to avoid surprises for other users).

I'd appreciate if you could validate and confirm that both - SDK and Terraform make it work for you

mnspodrska commented 2 weeks ago

thank you very much! Will try it over weekend and report on Monday

mnspodrska commented 2 weeks ago

I have tested, and something works, something does not work. See coment on https://github.com/vmware/terraform-provider-vcd/pull/1298