Open mvanleest opened 12 years ago
Apparently it's not the createSignature() function. Tested on CF9 & Railo 3.3.4.003 and both produce the same outcome.
Has anyone found a solution here for Railo? We had a similar project (Json WebToken) with HMAC-256 signatures and could circumvent this by using tobinary(tobase64(string)) instead of string.getbytes(). I've tried this with this component, but with no luck.
By the way, when CF9 and Railo 3.3.4, I assume it's working on both, but not on Railo 4?
OK, found and solved the Railo issue. For anyone interested: Edit amazonAWS.cfc, change function name "urlEncode" to "urlEncodeNormal" (line 38) and the function call in line 65 (in the function 'naturalbyteorder') from urlEncode(listrest(item,'=')) to urlEncodeNormal(listrest(item,'=')).
urlEncode is a built-in function and can't be overwritten in Railo, therefore you need to rename the function.
The signature is incorrect formatted if any function is called on Railo. A "SignatureDoesNotMatch" error is returned.
I narrowed it down to the createSignature() function. The arguments.secretKey.getBytes() gives a different output on CF then on Railo. Not sure if it's just the cfdump formatting, but in CF it's 1 long number (binary) and on Railo it's a Native Array (byte[]) output with dashed between 2 numbers.
That is as far as I could go with debugging this issue (for now).