simonfree / cfAWSWrapper

A Series of ColdFusion Wrappers for Amazon Web Services
16 stars 9 forks source link

Railo unsupported #4

Open mvanleest opened 12 years ago

mvanleest commented 12 years ago

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).

mvanleest commented 12 years ago

Apparently it's not the createSignature() function. Tested on CF9 & Railo 3.3.4.003 and both produce the same outcome.

ghost commented 10 years ago

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?

ghost commented 10 years ago

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.