ConfigMgr

VMware, Azure and Automation

Connecting to Cloud Director using API Token

17 oktober 2023 Cloud Director VMware

When you log in to VMware Cloud Director you can use a username and password. But for automation purposes like Terraform, this is not very user-friendly. For this kind of applications, you can use API access tokens.

From https://docs.vmware.com/en/VMware-Cloud-Director/10.4/VMware-Cloud-Director-Tenant-Portal-Guide/GUID-A1B3B2FA-7B2C-4EE1-9D1B-188BE703EEDE.html:

Starting with VMware Cloud Director 10.3.1, you can generate and issue API access tokens. You are authenticated using your respective security best practices, including leveraging two-factor authorization, by using API access tokens, you can grant access for building automation against VMware Cloud Director.

Access tokens are artifacts that client applications use to make API requests on behalf of a user. Applications need access tokens for authentication. When an access token expires, to obtain access tokens, applications can use API tokens. API tokens do not expire.

When using access tokens, applications cannot perform certain tasks.

  • Change the user password
  • Perform user management tasks
  • Create more tokens
  • View or revoke other tokens

When accessing VMware Cloud Director by using an API access token, applications have only view rights for the following resources.

  • User
  • Group
  • Roles
  • Global roles
  • Rights bundles

Applications accessing VMware Cloud Director by using an API access token do not have the following rights.

  • Token: Manage
  • Token: Manage All

But how do you use an API access token i.e. with Postman?

First, you have to generate a token. How this is done can be found in the previous link. When you have a token save it in a safe place because you cannot retrieve the token again.

Then make a request from Postman with the following attributes

POST https://host_name/oauth/provider/token
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Content-Length: 71
Body
grant_type=refresh_token&refresh_token=Generated_API_Token

The response will include an access token with token_type Bearer. Copy this token and use it in subsequent API calls using the Bearer Token authentication type.

GET https://host_name/api/org
Accept: application/*+xml;version=36.1
Authorization: Bearer Generated_Access_Token
apiiactokenvcd

Cloud Director VAMI Setup - NFS Errors

VCF pre-check error installing async patch

Recent Posts

  • Using API for Aria OPS Chargeback
  • Unable to set reservation on Org VDC
  • Veeam Tweaks
  • VCF Anyone? Get your license for free…
  • Configure Entra ID as Cloud Director IdP

Recent Comments

Geen reacties om te tonen.

Archives

  • april 2025
  • maart 2025
  • november 2024
  • oktober 2024
  • januari 2024
  • november 2023
  • oktober 2023
  • september 2023
  • juni 2023
  • mei 2023
  • april 2023
  • november 2022
  • maart 2021
  • februari 2021
  • januari 2021
  • november 2020
  • oktober 2020
  • september 2020
  • juli 2020
  • juni 2020
  • april 2020
  • maart 2020
  • februari 2020
  • oktober 2019
  • september 2019
  • juli 2019
  • juni 2019
  • mei 2019
  • maart 2019
  • februari 2019
  • januari 2019
  • december 2018
  • november 2018
  • april 2018
  • januari 2018
  • juli 2017
  • juni 2017
  • mei 2017

Categories

  • AnyLinq
  • Azure
  • Cloud Director
  • ConfigMgr
  • DIY
  • HomeAssistant
  • Microsoft
  • PowerCli
  • Powershell
  • SCCM
  • Script
  • Solutions
  • System Center
  • Veeam
  • VMware
  • vRealize Automation
  • vRealize Orchestrator
Proudly powered by WordPress | Theme: Doo by ThemeVS.