Layer7 API Management

Expand all | Collapse all

Need to create user via RESTMAN API

Jump to Best Answer
  • 1.  Need to create user via RESTMAN API

    Posted 06-20-2018 05:50 AM

    Hi Team,

     

    I have created a user with "username" and "password" via RESTMAN API. This situation is working for me when i am giving users with password. But in my project all the users are login into Policy Manager with CERTIFICATEs rather than uname and password. 

     

    Can someone please tell me on how to acheive this scenario if i want to create a user who can only access via Certificate to Policy manager.

     

    Thanks

    Praty



  • 2.  Re: Need to create user via RESTMAN API

    Posted 06-20-2018 11:25 AM

    After you have created the user you can PUT the certificate to the user like so.

     

    PUT /restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/00000000000000000000000000000003/certificate 

     

     

    <l7:CertificateData xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Encoded>
    PEM ENCODED Certificate
    </l7:Encoded>
    </l7:CertificateData>



  • 3.  Re: Need to create user via RESTMAN API

    Posted 06-20-2018 11:59 AM

    Thanks for the reply Barry.

     

    I have 2 doubts:

     

    1.) The URL will be : PUT /restman/1.0/identityProviders/0000000000000000fffffffffffffffe/users/00000000000000000000000000000003/certificate OR

    PUT /restman/1.0/users/00000000000000000000000000000003/certificate

     

    I have only 1 Identity Provider so i think both should work ?

     

    2.) How we will generate the encode value of below details:

     

    <l7:Encoded>
    PEM ENCODED Certificate 
    </l7:Encoded>

     

    Thanks for reply.

     

    Regards

    Praty



  • 4.  Re: Need to create user via RESTMAN API
    Best Answer

    Posted 06-21-2018 10:20 AM

    Party,

     

    regarding item 1 - either will work if you are using the internal identity provider only.

     

    the PEM is the base64 encoded certificate contained in a pem file. it would be obtained how ever you generate and obtained user public certificates today.