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.
API Gateway 10.x - 11.x
Because values are encrypted, cannot be directly retrieved in plain text.
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>