-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add SAML flow support ADFS endpoint "/adfs/services/trust/13/usernamemixed" #504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't test as don't have ADF server
CHANGELOG.md
Outdated
@@ -6,6 +6,8 @@ IMPROVEMENTS: | |||
* Removed code that handled specific cases for API 29.0 and 30.0. This library now supports VCD versions from 9.5 to 10.1 included [GH-499] | |||
* Added command line flags to test suite, corresponding to environment variables listed in TESTING.md [GH-505] | |||
* `resource/vcd_vapp_vm` allows creating VM from multi VM vApp template [GH-501] | |||
* Add support for SAML auth with Active Directory Federation Services (ADFS) as IdP using | |||
"/adfs/services/trust/13/usernamemixed" endpoint. [GH-502] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. More after a new round of tests
vcd/auth_saml_test.go
Outdated
"github.com/hashicorp/terraform-plugin-sdk/helper/resource" | ||
) | ||
|
||
// TestAccVcdSamlAuth explicitly tests a simple operation using SAML auth when explicit SAML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TestAccVcdSamlAuth explicitly tests a simple operation using SAML auth when explicit SAML | |
// TestAccVcdSamlAuth tests a simple operation using SAML auth when explicit SAML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
vcd/config_test.go
Outdated
UseSamlAdfs bool `json:"useSamlAdfs"` | ||
CustomAdfsRptId string `json:"customAdfsRptId,omitempty"` | ||
|
||
// The below `SamlUser`, `SamlPassword` and `SamlCustomRptId` variables are optional and are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The below `SamlUser`, `SamlPassword` and `SamlCustomRptId` variables are optional and are | |
// The variables `SamlUser`, `SamlPassword` and `SamlCustomRptId` are optional and are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
vcd/sample_vcd_test_config.json
Outdated
@@ -6,6 +6,14 @@ | |||
"user": "root", | |||
"password": "somePassword", | |||
"token": "Access token to be used instead of username/password", | |||
|
|||
"//": "Below 3 fields allow to set SAML credentials for tests that specifically use it.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"//": "Below 3 fields allow to set SAML credentials for tests that specifically use it.", | |
"//": "The 3 fields below allow to set SAML credentials for tests that specifically use it.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
vcd/sample_vcd_test_config.json
Outdated
|
||
"//": "Below 3 fields allow to set SAML credentials for tests that specifically use it.", | ||
"//": "May be useful when local user credentials are used by default.", | ||
"//": "The below credentials will authenticate to Org specified in vcd.org parameter.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"//": "The below credentials will authenticate to Org specified in vcd.org parameter.", | |
"//": "These credentials will authenticate to the Org specified in vcd.org parameter.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat PR. Have one user-facing field naming/typing to resolve.
org = "System" | ||
url = "${var.vcd_url}" | ||
max_retry_timeout = "${var.vcd_max_retry_timeout}" | ||
allow_unverified_ssl = "${var.vcd_allow_unverified_ssl}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clearing this up!
website/docs/index.html.markdown
Outdated
@@ -186,7 +209,17 @@ The following arguments are used to configure the VMware vCloud Director Provide | |||
instead of username and password. When this is set, username and password will | |||
be ignored, but should be left in configuration either empty or with any custom values. | |||
A token can be specified with the `VCD_TOKEN` environment variable. | |||
|
|||
|
|||
* `use_saml_adfs` - (Optional) Set `true` to use SAML login flow with Active Directory Federation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In discussions about this field. Options so far:
saml_adfs_enabled
saml_adfs_auth_enabled
auth_type = "saml_adfs" | "native" (default) | "token" | "ldap"
CC: @dataclouder @vbauzysvmware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my vote auth_type if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comments below, LGTM otherwise!
- Please add a line about official support for LDAP auth type to CHANGELOG.md
- Would like to see tests passing for @vbauzysvmware on his ADFS before merging
- Travis is failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Replicated ADFS and tested on my env. |
…mixed" (#504) * Add SAML support with ADFS
…mixed" (#504) * Add SAML support with ADFS
…mixed" (#504) * Add SAML support with ADFS
This PR adds support for SAML login using Microsoft Active Directory Services as Identity Provider (IdP).
It introduces two new
provider
section variablesuse_saml_adfs
andsaml_rpt_id
to alter login flow.Testing
PR adds a few new variables to configuration struct:
It allows to triggers explicitly a test
TestAccVcdSamlAuth
designed to try SAML authentication and can be useful if local users are used for main testing.More details about flow and how it works is in go-vcloud-director SDK PR (vmware/go-vcloud-director#304) as this is where it all is handled. The main point of SDK PR is to make it as easy as possible to use new features.
This PR demonstrates it by showing how little SDK user needs to do.