IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  ISVA Rest API -- pdamin user command oddities

    Posted Fri November 19, 2021 06:32 AM
    Hi,

    I'm a bit confused with the response "from" (in this example) the pdadmin user rest API call

    I'm posting the following JSON command to my config instance https://myISVAHost:port/isam/pdadmin using
    {"admin_id":"sec_master", "admin_pwd":"xxxxxxxxxxxx", "commands":["user list-dn *demo 55"]}
    I read the response content to a byte buffer and create a "UTF-8" string from the buffer and this is what i get:

    {"result":"cmd> user list-dn *demo 55\nuid=demoeid,cn=users,...DC=SE\nuid=demoeao,cn=users,...DC=SE\nuid=demoeao2,cn=users,...DC=SE\nuid=demontmedia,cn=users,...DC=SE\nuid=demoncc,cn=users,...DC=SE\nuid=demoicn,cn=users,...DC=SE\nuid=demoalecta,cn=users,...DC=SE\nuid=demo,cn=users,...DC=SE\nuid=hrmpoldemo,cn=users,...DC=SE\nuid=demoms,cn=users,...dc=se"}

    The '\' is actually the hex character '5C', an ASCII representation of the non-printable "\"??

    If I bite that bullet and
    replaceAll("\\x5cn", "\n") in the string, the result looks better;

    {"result":"cmd> user list-dn *demo 55
    uid=demoeid,cn=users,...DC=SE
    uid=demoeao,cn=users,...DC=SE
    uid=demoeao2,cn=users,...DC=SE
    uid=demontmedia,cn=users,...DC=SE
    uid=demoncc,cn=users,...DC=SE
    uid=demoicn,cn=users,...DC=SE
    uid=demoalecta,cn=users,...DC=SE
    uid=demo,cn=users,...DC=SE
    uid=hrmpoldemo,cn=users,...DC=SE
    uid=demoms,cn=users,...dc=se"}

    BUT -- is it really JSON??
    I would expect something like below :-)

    {"result":"cmd> user list-dn *demo 55",
    "users":["uid=demoeid,cn=users,...DC=SE,
    uid=demoeao,cn=users,...DC=SE,
    uid=demoeao2,cn=users,...DC=SE,
    uid=demontmedia,cn=users,...DC=SE,
    uid=demoncc,cn=users,...DC=SE,
    uid=demoicn,cn=users,...DC=SE,
    uid=demoalecta,cn=users,...DC=SE,
    uid=demo,cn=users,...DC=SE,
    uid=hrmpoldemo,cn=users,...DC=SE,
    uid=demoms,cn=users,...dc=se"]}

    PS. I'm using Java 8 with Apache HTTP client5

    Rgds & have a nice weekend...

    ------------------------------
    Anders Domeij
    CGI Sweden AB
    ------------------------------


  • 2.  RE: ISVA Rest API -- pdamin user command oddities

    Posted Fri November 19, 2021 04:07 PM
    Anders,
     
    The output of the pdadmin command is text, within a json payload.  So, even though the Web service response is JSON, the contents of the 'result' field, is just the textual output from running the pdadmin command.
     
    I hope that this explains things.
     
    Scott A. Exton
    Senior Software Engineer
    Chief Programmer - IBM Security Verify Access

    IBM Master Inventor

     
     
     





  • 3.  RE: ISVA Rest API -- pdamin user command oddities

    Posted Mon November 22, 2021 02:58 AM
    Hi Scott,

    Thanks for the quick reply.

    Rgds

    ------------------------------
    Anders Domeij
    CGI Sweden AB
    ------------------------------