V1.3.0 API Authorization denied

  • Now that C/D 1.3.0 is out, following [url=https://forum.clonedeploy.org/358-api-for-managing-from-external-application/]API for managing from external application[/url], I am trying to use the new API.

    The best that I got so far is:

    $ curl --show-error --insecure --header "Authorization:$(echo -n ${TOKEN} | base64)" http://${CLONEDEPLOY_HOST}/clonedeploy/api/Computer/GetByName?name=${COMPUTER_NAME} --connect-timeout 10 --stderr -
    {"Message":"Authorization has been denied for this request."}

    for ${TOKEN} I tried:

    • the imaging token under clonedeploy/views/users/edit.aspx?userid=1
    • the universal Token under clonedeploy/views/admin/security.aspx

    What am I missing here?

  • Have you read this yet?


  • To expand a little on this. There are two different authentication mechanisms for the api. The clientimaging controller(this is used by all imaging scripts) uses the tokens you described above. All other controllers use an oauth2 token. The reason they are different is to allow client imaging without the need for a user login by simply passing the token, cant really do that with oauth2. So in your example above you could only call methods in the clientimaging controller, which is probably not what you are looking for. So you will need to implement the oauth2 token for the computer controller.