Using Restman To Update Stored Password
search cancel

Using Restman To Update Stored Password

book

Article ID: 187304

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

It might be required to update a manged stored password without the use of Policy Manager.
You can make a restman call to accomplish this task.

Environment

Applicable to any Gateway version.

Resolution

You would first need to obtain the id of the Stored Password for which you would like to update.

You can send the following request via a rest client such as postman to obtain that:

HTTP Method: Get
https://GatewayHostName:8443/restman/1.0/passwords?name=MyStoredPasswordName


You will see the following within the generated response:


 <l7:StoredPassword id="9d2a35cc52c836e10f76e2ac10eeeeee" version="1">


You can now send the following kind of request to update that stored password:

HTTP Method: Put
https://GatewayHostName:8443/restman/1.0/passwords/9d2a35cc52c836e10f76e2ac10eeeeee


The body of the request would contain something along the following:

<l7:StoredPassword xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
              <l7:Name>MyStoredPasswordName</l7:Name>
              <l7:Password>MyUpdatedPasswordHere</l7:Password>
                <l7:Properties>
                    <l7:Property key="description">
                        <l7:StringValue></l7:StringValue>
                    </l7:Property>
                    <l7:Property key="lastUpdated">
                        <l7:DateValue>2020-03-19T13:03:37.808-04:00</l7:DateValue>
                    </l7:Property>
                    <l7:Property key="type">
                        <l7:StringValue>Password</l7:StringValue>
                    </l7:Property>
                    <l7:Property key="usageFromVariable">
                        <l7:BooleanValue>true</l7:BooleanValue>
                    </l7:Property>
                </l7:Properties>
            </l7:StoredPassword>



The stored password would be updated with the value specified in the <l7:Password>xxxxxxx</l7:Password>
section of the PUT request from above.

Additional Information

You can use restman to accomplish many things with the gateway.
To access the restman documentation you can hit the following endpoint:

https://GatewayHostName:8443/restman/1.0/doc