Skip to content

Commit 642c11f

Browse files
Merge pull request #178 from dimitarproynov/main
Update documentation with the OAuth App authentication capability
2 parents b7a2ff8 + caa5c0a commit 642c11f

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

Diff for: examples/main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ terraform {
66
}
77
}
88
provider "vmc" {
9-
refresh_token = var.api_token
9+
client_id = var.client_id
10+
client_secret = var.client_secret
1011
org_id = var.org_id
1112
}
1213
# Empty data source defined in order to store the org display name and name in terraform state

Diff for: examples/variables.tf

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
variable "api_token" {
2-
description = "API token used to authenticate when calling the VMware Cloud Services API."
1+
variable "client_id" {
2+
description = "ID of an OAuth App associated with the organization. It is recommended to use an OAuth App with least-privileged roles in automated environments."
33
default = ""
44
}
55

6+
variable "client_secret" {
7+
description = "Secret of the OAuth App, associated with the organization. It is recommended to use an OAuth App with least-privileged roles in automated environments."
8+
default = ""
9+
}
10+
11+
612
variable "org_id" {
713
description = "Organization Identifier."
814
default = ""

Diff for: website/docs/index.html.markdown

+8-4
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ resources.
2121
In order to use the provider you need to obtain the authentication
2222
token from the Cloud Service Provider by providing the org scoped API token.
2323
The provider client uses Cloud Service Provider (CSP) API
24-
to exchange this org scoped API token for user access token.
24+
to exchange this org scoped API token/OAuth App Id and Secret for user access token.
2525

26-
Note that in all of the examples you will need to update the `api_token` and `org_id` settings
27-
in the variables.tf file to match those configured in your VMC environment.
26+
Note that in all the examples you will need to update the `client_id` and `client_secret` or `api_token`
27+
and `org_id` settings in the variables.tf file to match those configured in your VMC environment.
2828

2929

3030
## Argument Reference
3131

3232
The following arguments are used to configure the VMware Cloud on AWS Provider:
3333

34-
* `api_token` - (Required) API token is used to authenticate when calling VMware Cloud Services APIs.
34+
* `api_token` - (Required, in conflict with "client_id" and "client_secret") API token is used to authenticate when calling VMware Cloud Services APIs.
3535
This token is scoped within the organization.
36+
* `client_id` - (Required in pair with "client_secret", in conflict with "api_token") ID of OAuth App associated with the organization. The combination with
37+
"client_secret" is used to authenticate when calling VMware Cloud Services APIs.
38+
* `client_secret` - (Required in pair with "client_id", in conflict with "api_token") Secret of OAuth App associated with the organization. The combination with
39+
"client_id" is used to authenticate when calling VMware Cloud Services APIs.
3640
* `org_id` - (Required) Organization Identifier.
3741
* `vmc_url` - (Optional) VMware Cloud on AWS URL. Default : https://vmc.vmware.com
3842
* `csp_url` - (Optional) Cloud Service Provider URL. Default : https://console.cloud.vmware.com

0 commit comments

Comments
 (0)