Layer 7 API Management

Expand all | Collapse all

Using the RESTMAN Gateway Manangement APIs to create an Internal Identity Provider user

Jump to Best Answer
  • 1.  Using the RESTMAN Gateway Manangement APIs to create an Internal Identity Provider user

    Posted 12-11-2017 03:20 PM

    Hello,

     

    I am trying to create an Internal Identity Provider user via RestMan and not sure where I can specify the new user's password in the XMLfile

     

    Below is my XML

    <l7:User providerId="0000000000000000fffffffffffffffe" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
        <l7:Login>migrationadmini2</l7:Login>
        <l7:FirstName>migrationadmin2</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>migrationadmin</l7:StringValue>
            </l7:Property>
        </l7:Properties>
    </l7:User>

     

     

    "url": "https://10.10.1.251:9443/restman/1.0/users"

    "method": "POST",

     

    Below is the output

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:Error xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Type>InvalidResource</l7:Type>
    <l7:TimeStamp>2017-12-11T15:08:15.307-05:00</l7:TimeStamp>
    <l7:Link rel="self" uri="https://10.10.1.251:9443/restman/1.0/users"/>
    <l7:Detail>Resource validation failed due to 'MISSING_VALUES' Password required</l7:Detail>
    </l7:Error>

     

    p.s.

    I tried to guess the syntax but no luck, e.g.

    <l7:User providerId="0000000000000000fffffffffffffffe" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
        <l7:Login>migrationadmini2</l7:Login>
        <l7:FirstName>migrationadmin2</l7:FirstName>
        <l7:LastName/>
        <l7:Email/>

        <l7:Password>************</l7:Password>
        <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>migrationadmin</l7:StringValue>
            </l7:Property>
        </l7:Properties>
    </l7:User>

     

    Or

    <l7:User providerId="0000000000000000fffffffffffffffe" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
        <l7:Login>migrationadmini2</l7:Login>
        <l7:FirstName>migrationadmin2</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>migrationadmin</l7:StringValue>
            </l7:Property>

            <l7:Property key="password">
                <l7:StringValue>********************</l7:StringValue>
            </l7:Property>
        </l7:Properties>
    </l7:User>

     

     

    Regards,

    Naichun



  • 2.  Re: Using the RESTMAN Gateway Manangement APIs to create an Internal Identity Provider user
    Best Answer

    Posted 12-11-2017 04:51 PM

    Create users

    Only for internal identity provider ( idProvider = 0000000000000000fffffffffffffffe). The Password field is required. Password format maybe "plain" for plaintext, or "sha512crypt" for a SHA512crypt hashed password. A plaintext password would be checked against the password policy.

    For an internal user, only the following fields will be saved:

    • Login
    • FirstName
    • LastName
    • Email
    HTTP MethodPOST
    URL

    /1.0/identityProviders/{idProviderId}/users

    Request Body
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <l7:User xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">     <l7:Login>dude</l7:Login>     <l7:Password format="plain">password</l7:Password>     <l7:FirstName>John</l7:FirstName>     <l7:LastName>Smith</l7:LastName>     <l7:Email>dude@here.com</l7:Email> </l7:User> 
    Response Status201
    Response Body Example
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">     <l7:Name>admin</l7:Name>     <l7:Id>28a881907e826975be6cf023be6fd24d</l7:Id>     <l7:Type>USER</l7:Type>     <l7:TimeStamp>2014-03-12T15:12:10.144-07:00</l7:TimeStamp>     <l7:Link rel="self" uri="http://localhost:80/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/28a881907e826975be6cf023be6fd24d"/>     <l7:Link rel="list" uri="http://localhost:80/restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users"/> </l7:Item>
    Possible errors

    404 - id provider not found
    400 - not internal id provider

     

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support



  • 3.  Re: Using the RESTMAN Gateway Manangement APIs to create an Internal Identity Provider user

    Posted 12-11-2017 05:47 PM

    Thanks a lot! Stephen!

     

    Yep, it works now. 

    Also, I have noticed that the order of each line in the XML file matters.

    e.g. Below is the working version,

     

    <l7:User providerId="0000000000000000fffffffffffffffe" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
       <l7:Login>migrationadmini2</l7:Login>
       <l7:Password format="plain">password</l7:Password>
       <l7:FirstName>migrationadmin2</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>migrationadmin</l7:StringValue>
          </l7:Property>
       </l7:Properties>
    </l7:User>

    But if you move password line b/t FirstName and LastName, error occurs

     

    <l7:User providerId="0000000000000000fffffffffffffffe" xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
       <l7:Login>migrationadmini2</l7:Login>
       <l7:FirstName>migrationadmin2</l7:FirstName>
       <l7:Password format="plain">**************</l7:Password>

       <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>migrationadmin</l7:StringValue>
          </l7:Property>
       </l7:Properties>
    </l7:User>

     

    Regards,

    Naichun



  • 4.  Re: Using the RESTMAN Gateway Manangement APIs to create an Internal Identity Provider user

    Posted 02-01-2018 05:33 AM

    Hi Stephen,

     

    Is restman supporting to create Policy-Backed Identity provider ? If yes ,Could you please let me know what will be input request XML that we can use to create policy-backed identity provider .

     

     

    Thanks!

    Prashant Srivastava