Follow the below steps to rotate the secret:
SSH as root to the primary node of VCF Operations.
Phase 1: Authentication & Discovery
Step 1: Fetch VCF SSO Auth Source ID
Retrieve all authentication sources to identify the VIDB source ID. Endpoint is unauthenticated.
curl -X 'GET' \
'https://<OPS_HOST>/suite-api/api/auth/sources' \
-H 'accept: application/json'
Step 2: Acquire Operations Token
Obtain an authentication token for the admin user. This token is required for all subsequent steps.
curl -X 'POST' \
'https://<OPS_HOST>/suite-api/api/auth/token/acquire' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "<ADMIN_USERNAME>",
"password": "<ADMIN_PASSWORD>"
}'
Note: Save the token value from the response. It will be used as <OPS_TOKEN> in headers below.
Step 3: Retrieve Current Auth Source Configuration
Fetch the existing configuration. Modify the following JSON structure for the final step.
curl -X 'GET' \
'https://<OPS_HOST>/suite-api/api/auth/sources/<AUTH_SOURCE_ID>' \
-H 'accept: application/json' \
-H 'Authorization: OpsToken <OPS_TOKEN>'
Phase 2: Secret Rotation
Before patching the source, generate a new secret for the VCF Ops Client.
Step 4: Identify the VIDB Resource ID
Identify the internal ID of the VIDB based on the hostname.
curl -X 'GET' \
'https://<OPS_HOST>/suite-api/internal/vidb/vidbs' \
-H 'accept: application/json' \
-H 'Authorization: OpsToken <OPS_TOKEN>' \
-H 'x-vrealizeops-api-use-unsupported: true'
Incase if the above command fails with an error " {"type":"Error","message":"Query Parameter \"vcfId\" is required.","httpStatusCode":400,"apiErrorCode":1509}" , you need to include the vcfId as a query parameter, as shown below:
curl -X 'GET' \
'https://<OPS_HOST>/suite-api/internal/vidb/vidbs?vcfId=<vcf-instance-id>' \
-H 'accept: application/json' \
-H 'Authorization: OpsToken <OPS_TOKEN>' \
-H 'x-vrealizeops-api-use-unsupported: true'
Note: <vcf-instance-id> can be found from the adapters API. Here are the steps:
- Login to VCF Operations UI with admin privileges
- Go to </> Developer Center > APIs & SDKs > Operations API, then launch the "API documentation"
- Authorize the page using "admin" or equivalent permissions
- Navigate to Adapters > GET /api/adapters > Click on "Try it out", then select Execute
- In the response body output, check for "VMware Cloud Foundation Adapter" and note down the "id"
- Use this id as the
<vcf-instance-id> in the above query parameter
Step 5: Rotate Secret for the VCF Ops Client
Execute the rotation.
Target Client ID: Identified from the Logs.
Note: If the <CLIENT_ID> can't be identified from the logs, you can manually identify it by following these steps:
- SSH to vCenter as
root user. - Run the following API to get VC Session:
curl -k --request POST --url https://<MGMT VC FQDN>/rest/com/vmware/cis/session -u '<Username>:<password>'
#Note: Here the username is [email protected]
- Run the following API to get tenant admin client token:
curl -k --location --request GET 'https://<MGMT VC FQDN>/api/vcenter/identity/broker/tenants/CUSTOMER/admin-client' --header 'vmware-api-session-id: <session id from step 1>' | jq
- Run the following API to get VC's provider info and note down the "
client_id" field from the below output: curl -k --request GET \
--url https://<MGMT VC FQDN>/api/vcenter/identity/providers/CUSTOMER \
--header 'content-type: application/json' \
--header 'vmware-api-session-id: <session from step 1>'
Resource ID: Use the ID found in Step 4.
curl --request PUT \
'https://<OPS_HOST>/suite-api/internal/vidb/oauthclients/<CLIENT_ID>/secrets/rotate?vidbResourceId=<RESOURCE_ID>' \
-H 'accept: application/json' \
-H 'Authorization: OpsToken <OPS_TOKEN>' \
-H 'x-vrealizeops-api-use-unsupported: true'
Critical: The API response will return the new client secret. Copy this value immediately for use in the final step.
Phase 3: Apply Configuration Patch
Step 6: Update Auth Source with New Credentials
Modify the configuration retrieved in Step 3 and apply the changes.
curl -X 'PUT' \
'https://<OPS_HOST>/suite-api/api/auth/sources' \
-H 'accept: application/json' \
-H 'Authorization: OpsToken <OPS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"id": "<AUTH_SOURCE_ID>",
"name": "VCF SSO",
"sourceType": {
"id": "VIDB",
"name": "VIDB"
},
"created": 0,
"lastModified": 0,
"property": [
{
"name": "display-name",
"value": "VCF SSO"
},
{
"name": "issuer-url",
"value": "https://<VCF_SSO_HOST>/acs/t/<TENANT_NAME>"
},
{
"name": "client-id",
"value": "<CLIENT_ID>"
},
{
"name": "client-secret",
"value": "<NEW_CLIENT_SECRET>"
}
],
"certificates": []
}'