Skip to main content

Invalid Signature XXX. String to sign.

Comments

1 comment

  • Aleksandar Kostadinov

    Hi Jirou,

    Looking at the parameters you're using for the signature generation - you are appending the Cloudinary API Key as the last part of the string to hash but the API Key shouldn't be included. Instead, please append the Cloudinary API Secret.

    In addition, the "type" parameter is defaulted to "upload" and thus isn't required in your string which generates the signature and also in the POST body unless it's different to "upload".

    Based on this, could you please try using the line below (replacing $CLOUDINARY_API_SECRET with your actual account secret):

    export SHA1=(echo "invalidate=true&public_id=PATH/TO/IMAGE&timestamp=$TIME$CLOUDINARY_API_SECRET" | openssl sha1)

    Your cURL line will therefore be:

    curl https://api.cloudinary.com/v1_1/PROJECT/image/destroy -X POST --data "invalidate=true&public_id=PATH/TO/IMAGE&timestamp=$TIME&signature=$SHA1&api_key=$CLOUDINARY_APIKEY"

    This part of our documentation goes through the steps of generating the authentication signatures manually:

    https://cloudinary.com/documentation/upload_images#generating_authentication_signatures

    Let me know how this goes.

    Best regards,

    Aleksandar

    0

Post is closed for comments.