Followed as suggested in the documentation but getting error "Invalid signature" #1162
Unanswered
devfishyhub
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Okay for anyone else trying this and you are newbie like me to this encryption and signing this: Duh. We should either use encryption only or signing only. should not try to combine both. Weirdly it is not clear from documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Well, you can use both encryption and signature. The problem with your code is that you singing const SECRET = "57ecc9c430cf3ae3370002bea013c5fbbe46962eb83e4402715c0009e1c6bd95";
const SALT = "24b7b48e7027ec8d0c7494e45206c0c6137142c69ff1a4cc7ee72098590183d7";
const URL_ENCRYPTION_KEY = '7a97cbb8bed64a2c1d4de074fac9bd81a81f319343576c282f7509bced6070cc';
const url = "https://i.imgur.com/KSLD4VV.jpeg";
const generator = new ImgProxySignatureGenerator(SECRET, SALT, URL_ENCRYPTION_KEY);
const encryptedUrl = generator.encryptUrl(url);
const path = `/rs:fit:300:300/enc/${encryptedUrl}.jpg`;
const signature = generator.signUrl(path);
const finalUrl = `http://localhost:8080/${signature}${path}`;
console.log(finalUrl); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys,
I am trying to play with this imgProxy. I have run my docker with this command:
docker run --env IMGPROXY_KEY=57ecc9c430cf3ae3370002bea013c5fbbe46962eb83e4402715c0009e1c6bd95 --env IMGPROXY_SALT=24b7b48e7027ec8d0c7494e45206c0c6137142c69ff1a4cc7ee72098590183d7 --env IMGPROXY_SIGNATURE_SIZE=32 --env IMGPROXY_SOURCE_URL_ENCRYPTION_KEY=7a97cbb8bed64a2c1d4de074fac9bd81a81f319343576c282f7509bced6070cc -p 8080:8080 -it darthsim/imgproxy
and here is the nodejs script i have used to generate the url:
I am not sure how the order should be? encrypt the url first then sign it? or sign the url and then encrypt it?
Beta Was this translation helpful? Give feedback.
All reactions