How to get the shared secret for a client ID from VMware Identity Manager via API
search cancel

How to get the shared secret for a client ID from VMware Identity Manager via API

book

Article ID: 438493

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

You need to programmatically retrieve the shared secret for an existing OAuth2 client ID in VMware Identity Manager (VIDM). Currently, you might be obtaining the shared secret manually through the UI (Administration Console > Catalog > Settings > Remote App Access) and require the equivalent API method to automate this workflow.

Environment

VMware Identity Manager 3.3.7

Cause

You have an administrative requirement to query and extract OAuth2 client configurations and secrets programmatically rather than navigating through the graphical user interface.

Resolution

To retrieve the shared secret using the REST API, perform the following steps:

  1. Authenticate to your environment and obtain an OAuth2 Bearer token that possesses the admin scope.

  2. Execute an HTTP GET request targeting the following OAuth2 Client Management API endpoint: https://<hostname>/SAAS/jersey/manager/api/oauth2clients/{id}

  3. Replace {id} in the URI with the specific clientId of your target client.

  4. Supply the retrieved Bearer token within the Authorization header of the request.

  5. Parse the returned JSON response body. The shared secret string is located within the secret key.