WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
    • VMware Cloud Foundation 9.1
    • VMware Cloud Foundation 9.0
  • VKS
  • Homelab
    • Hardware Options
    • Hardware Reviews
    • Lab Deployment Scripts
    • Nested Virtualization
    • Homelab Podcasts
  • VMware Nostalgia
  • Apple
You are here: Home / VMware Cloud on AWS / How to retrieve the CSP Refresh Token expiry using the CSP API

How to retrieve the CSP Refresh Token expiry using the CSP API

01.11.2019 by William Lam // Leave a Comment

I recently had question from a customer who wanted to automate the retrieval of the expiry for a given Cloud Services Platform (CSP) Refresh Token so that they could monitor it programmatically and setup notifications before the token expires. The CSP Refresh Token is required to interact with solutions within CSP including VMware Cloud on AWS (VMC).

Customers can check the current Refresh Token expiry along with the initiate create and last used time by navigating to "My Account" in the CSP UI and under "API Tokens" as shown in the screenshot below.


To retrieve this programmatically using the CSP REST API, you will need to provide a valid Refresh Token and then perform a POST am/api/auth/api-tokens/details

Here is an example using cURL:

curl -s -X POST -H "Content-Type: application/json" "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/details" -d "{tokenValue=$REFRESH_TOKEN}"


Similarly, for those that use PowerCLI and PowerShell, I have updated my PowerShell CSP community module to include a new function called Get-CSPRefreshTokenExpiry which will nicely return the formatted output given a Refresh Token as shown in the example below.

Get-CSPRefreshTokenExpiry -RefreshToken $RefreshToken

Categories // VMware Cloud on AWS Tags // Cloud Services Platform, CSP, PowerCLI, powershell

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • VCF 9.1 - Unable to fetch plugin metadata for VCF Consumption CLI 05/13/2026
  • VCF 9.1 - Updated VCF Design Blueprints & VCF Fleet Latency Diagrams for VCF Architects 05/12/2026
  • VCF 9.1 - Comprehensive VCF Installer & SDDC Manager Configuration Workarounds for Lab Deployments 05/11/2026
  • VCF 9.1 - Comprehensive ESX Configuration Workarounds for Lab Deployments 05/11/2026
  • VCF 9.1 - New HTTP Offline Depot Support for VCF Installer & Fleet Depot Service 05/08/2026

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2026

Loading Comments...