Skip to content
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 VMC Oauth app support #1080

Merged
merged 4 commits into from
Jan 23, 2024
Merged

Add VMC Oauth app support #1080

merged 4 commits into from
Jan 23, 2024

Conversation

wsquan171
Copy link
Contributor

@wsquan171 wsquan171 commented Jan 9, 2024

This change adds support of NSX token exchange on VMC using Oauth app, which is a newer method compared to using refresh token.

Implementation mainly referenced python client for vmc on aws and terraform vmc provider.

Testing done:
With Oauth app created in server-to-server mode, assigned with all roles under "VMware Cloud on AWS" category, provider configured as:

provider "nsxt" {
  host                 = "<nsx-private-ip>.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/<org-id>/sddcs/<ssdc-id>/sks-nsxt-manager"
  allow_unverified_ssl = true
  max_retries          = 2
 
  enforcement_point    = "vmc-enforcementpoint"
  vmc_client_id        = "<oauth-app-id>"
  vmc_client_secret    = "<oauth-app-secret>"
}

Able to create and delete resources like:

resource "nsxt_policy_gateway_qos_profile" "test" {
  display_name        = "test"
  description         = "Terraform provisioned profile"
  burst_size          = 10
  committed_bandwidth = 20
}

For regression, verified using access token to create and delete the same resource. The provider is configured as follows:

provider "nsxt" {
  host                 = "<nsx-private-ip>.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/<org-id>/sddcs/<ssdc-id>/sks-nsxt-manager"
  allow_unverified_ssl = true
  max_retries          = 2
 
  enforcement_point    = "vmc-enforcementpoint"
  vmc_token            = "<access-token>"
}

e2e test covers non-vmc cases.

Closes #944

@wsquan171 wsquan171 force-pushed the vmc-oauth branch 2 times, most recently from 44f4cf6 to a1aee6a Compare January 9, 2024 23:06
@wsquan171
Copy link
Contributor Author

/test-all

@wsquan171 wsquan171 force-pushed the vmc-oauth branch 2 times, most recently from ec6567a to dadc2ab Compare January 10, 2024 22:03
@wsquan171
Copy link
Contributor Author

/test-all

@wsquan171 wsquan171 force-pushed the vmc-oauth branch 2 times, most recently from c589bcb to b0c81ef Compare January 22, 2024 18:10
@wsquan171
Copy link
Contributor Author

/test-all

2 similar comments
@wsquan171
Copy link
Contributor Author

/test-all

@wsquan171
Copy link
Contributor Author

/test-all

This change adds support of NSX token exchange on VMC using Oauth app,
which is a newer method compared to using refresh token.

Signed-off-by: Shawn Wang <[email protected]>
Signed-off-by: Shawn Wang <[email protected]>
This reverts commit bc6d933.

Signed-off-by: Shawn Wang <[email protected]>
@wsquan171 wsquan171 merged commit f1e5494 into vmware:master Jan 23, 2024
2 checks passed
GraysonWu pushed a commit to GraysonWu/terraform-provider-nsxt that referenced this pull request Jan 26, 2024
This change adds support of NSX token exchange on VMC using Oauth app,
which is a newer method compared to using refresh token.

Signed-off-by: Shawn Wang <[email protected]>
Signed-off-by: graysonwu <[email protected]>
GraysonWu added a commit to GraysonWu/terraform-provider-nsxt that referenced this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oauth App Support for VMConAWS authentication
2 participants