Broadcom API Gateway - How to retrieve the value of encrypted entities under Managed Stored Password
search cancel

Broadcom API Gateway - How to retrieve the value of encrypted entities under Managed Stored Password

book

Article ID: 275503

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Use Case: password/API keys entities added in Policy Manager > Manage Stored Passwords are by default stored with encryption in the SSG Database. There is a requirement for recovering their content in plain text format.

 

Environment

API Gateway 10.x - 11.x

Cause

Because values are encrypted, cannot be directly retrieved in plain text.

Resolution

In order to retrieve the value, we first ensure that the key is enabled (if not, enable it) to be used in a context variable, see the below screenshot:

Then we can use the context variable ${secpass.<name>.plaintext} to retrieve its value. NOTE: the <name> in the context variable needs to be replaced to match the "name" of the stored entity. 

So for example the API Key in this case is called "apikey".

We can, for example, retrieve its value by calling the context variable via API using the "Return Template Response" assertion:

 

Here is a sample of the CURL command to call the API and retrieve the value from secpass context variable

# curl http://<gayewayhostname>:8080/<api_name>