Layer7 API Management

 View Only

Using the RESTMAN Gateway Manangement APIs to change the password of an Internal Identity Provider user 

Sep 25, 2015 06:41 AM

It is not possible to modify the password through the Update User API using the RESTMan interface:-


PUT HTTPS://<gatewayHostname>:8443/restman/1.0/users/{userID}


However a separate API can be called to modify the password.  First off we need to obtain the internal ID the user we wish to change by calling:-

 

GET  HTTPS://<gatewayHostname>:8443/restman/1.0/users

 

This will return:-

 

<l7:List xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">

   <l7:Name>USER List</l7:Name>

   <l7:Type>List</l7:Type>

   <l7:TimeStamp>2015-09-25T10:10:01.774+01:00</l7:TimeStamp>

   <l7:Link rel="self" uri="https://<gatewayHostname>:8443/restman/1.0/users"/>

   <l7:Link rel="template" uri="https://<gatewayHostname>:8443/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/template"/>

   <l7:Item>

      <l7:Name>test</l7:Name>

      <l7:Id>dad3a53837d7dffa8a6441bf05a01465</l7:Id>

      <l7:Type>USER</l7:Type>

      <l7:TimeStamp>2015-09-25T10:10:01.773+01:00</l7:TimeStamp>

      <l7:Link rel="self" uri="https://<gatewayHostname>:8443/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/dad3a53837d7dffa8a6441bf05a01465"/>

      <l7:Resource>

         <l7:User providerId="0000000000000000fffffffffffffffe" id="dad3a53837d7dffa8a6441bf05a01465">

            <l7:Login>test</l7:Login>

            <l7:FirstName/>

            <l7:LastName/>

            <l7:Email/>

            <l7:Properties>

               <l7:Property key="accountExpiration">

                  <l7:LongValue>-1</l7:LongValue>

               </l7:Property>

               <l7:Property key="enabled">

                  <l7:BooleanValue>true</l7:BooleanValue>

               </l7:Property>

               <l7:Property key="name">

                  <l7:StringValue>test</l7:StringValue>

               </l7:Property>

            </l7:Properties>

         </l7:User>

      </l7:Resource>

   </l7:Item>

   <l7:Item>

      <l7:Name>admin</l7:Name>

      <l7:Id>00000000000000000000000000000003</l7:Id>

      <l7:Type>USER</l7:Type>

      <l7:TimeStamp>2015-09-25T10:10:01.773+01:00</l7:TimeStamp>

      <l7:Link rel="self" uri="https://<gatewayHostname>:8443/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/00000000000000000000000000000003"/>

      <l7:Resource>

         <l7:User providerId="0000000000000000fffffffffffffffe" id="00000000000000000000000000000003">

            <l7:Login>admin</l7:Login>

            <l7:FirstName/>

            <l7:LastName/>

            <l7:Email/>

            <l7:Properties>

               <l7:Property key="accountExpiration">

                  <l7:LongValue>-1</l7:LongValue>

               </l7:Property>

               <l7:Property key="enabled">

                  <l7:BooleanValue>true</l7:BooleanValue>

               </l7:Property>

               <l7:Property key="name">

                  <l7:StringValue>admin</l7:StringValue>

               </l7:Property>

            </l7:Properties>

         </l7:User>

      </l7:Resource>

   </l7:Item>

</l7:List>

 

In this case I aim to change the password of user test, which has an internal id of  dad3a53837d7dffa8a6441bf05a01465.  Thus we can update the password by calling:-

 

PUT  HTTPS://<gatewayHostname>:8443/restman/1.0/users/dad3a53837d7dffa8a6441bf05a01465/password


The body needs a media type of applciation/xml, however no XML is needed, the body should just contain the password. If successful this will return XML listing the user details.  See my SoapUI request for details:-


soapuichangepasswordrequest.png


Statistics
0 Favorited
14 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Sep 25, 2015 09:23 AM

I tested this with the out of the box Restman at 8.3

Sep 25, 2015 08:54 AM

Is there a specific version of the RESTMAN API that this is limited to or does this apply to any and all versions?

Related Entries and Links

No Related Resource entered.