Generate the certificate
- Generate a certificate CSR.
example:
openssl req -x509 -newkey rsa:4096 -keyout samlkey.key -out samlcert.csr -sha256 -days 3650 -nodes
- Send the CSR to your Certificate Authority(CA) for signing. CA should return to you a signed certificate in PEM format.
Import the Certificate to Cloud Director
- Login to the Tenant portal as an Organization Administrator and then navigate to 'Administration → Certificate Management → Certificate Library'
- Click the 'Import' button and proceed to import the certificate. Fill in certificate 'Friendly Name', Select the File, Enter the Passphrase if configured and Import.
Reference to Import Certificates to the Certificates Library Using Your VMware Cloud Director Tenant Portal if required.
Retrieve the URN of the newly imported certificate
- Login to the Tenant portal as an Organization Administrator.
- Click the inverted caret and select the 'API Explorer' link.

- In the API Explorer page locate the API named
/1.0.0/ssl/certificateLibrary. Select the API and then click the 'Try it out' button.

- Click the 'Execute' button to run the API.

- Scroll down the page and examine the 'Response body' content section. The response body will contain the details of all SSL certificates which are uploaded to the Tenant's Certificate Library. They are easily identifiable using the 'alias' value for each certificate. The 'alias' value you seek will match the Friendly Name which was provided earlier in the process while importing the certificate.
- Locate the SAML certificate which the Tenant wants to apply to their Organization by locating the '
alias' in the response body.
- Record the '
ID' value found on the line above the certificate 'alias'. This is the URN.
example:
"id": "urn:vcloud:certificateLibraryItem:12345678-####-####-########"
Retrieve the Org ID of the Tenant
- Login to the Tenant portal as an Organization Administrator and open API Explorer as previously shown.
- Locate the API named
/1.0.0/orgs.
- Execute the API and examine the response body. Record the
ID URN value of the Organization.
example:
"id": "urn:vcloud:org:222333##-####-####-####-########"
Update the Organization federation settings to use the custom SAML certificate
- Login to the Cloud Director API using an API client of your choice. Refer to How to establish an API connection VMware Cloud Director if required.
- Perform a
GET request against the organization to confirm its current federation settings. The Org ID used here will match the Org URN identified previously.
GET https://cloud.example.com/api/admin/org/222333##-####-####-####-########/settings/federation
- Examine the API response body and locate the entries for 'SigningCertLibraryItemId' and 'EncryptionCertLibraryItemId'.
example:
<SigningCertLibraryItemId>abcdefg###-####-####-####-########</SigningCertLibraryItemId>
<EncryptionCertLibraryItemId>9876####-####-####-####-########</EncryptionCertLibraryItemId>
- Modify the 'SigningCertLibraryItemId' and 'EncryptionCertLibraryItemId' values. Overwrite the the existing values and apply the
certificateLibraryItem URN ID identified earlier when querying the certificateLibrary API.
example:
<SigningCertLibraryItemId>12345678-####-####-########</SigningCertLibraryItemId>
<EncryptionCertLibraryItemId>12345678-####-####-########</EncryptionCertLibraryItemId>
- Perform a
PUT request to the organization with the modified body.
PUT https://cloud.example.com/api/admin/org/222333##-####-####-####-########/settings/federation
- Confirm the change is made by navigating to 'Administration -> Identity Providers -> SAML' in the Tenant UI. The Certificate Expiration will match that which you set in your custom certificate.
Note: If a user clicks the 'Regenerate Certificate' button on the SAML UI page it will overwrite the change and reset the SAML certificate to use a default certificate with one year validity.