Search code examples
curlaemjcrcrx

CURL for creating a AEM/CQ user under the "/home/users/test/" path


what is the parameter that need to be used for creating an AEM user under the path "/home/users/test/"? Also where can i get the curl documentation that can be used with AEM/CQ

currently i am using the below crul command for creating a user. but the user still creates under "/home/users/randomnumber/encryptednode/"

curl -u admin:admin -FcreateUser= -FauthorizableId=testuser -Frep:password=testuser -FPath="/home/users/test/" http://localhost:4502/libs/granite/security/post/authorizables

Solution

  • Instead of path use intermediatePath

    curl -u admin:admin -FcreateUser= -FauthorizableId=testuser -Frep:password=testuser -FintermediatePath="test" http://localhost:4502/libs/granite/security/post/authorizables
    

    For some reference on curl commands refer here

    In addition to this there is a trick to get CURL equivalent for most of the operations on AEM that are done via GUI,

    • Use firefox with firebug enabled and network tab selected
    • Perform the operation via AEM GUI and observe the requests in network tab
    • Get the relevant request that performs the activity for which you need curl, in your case it was POST request
    • Right click and select the option Copy As Curl to get the curl command of that operation. It will have lot of information and you will have to clean it up. To get the update to your command, all I did was look for the parameter that sends the path test and updated your query.