tag:blogger.com,1999:blog-8392508371021961521.post6508550202216827498..comments2014-10-17T18:26:34.559-05:00Comments on ColdFusioned Security: Amazon HMAC with ColdFusionPhillyunhttp://www.blogger.com/profile/01761189954217808878noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-8392508371021961521.post-59058891354214414602014-10-17T18:26:34.559-05:002014-10-17T18:26:34.559-05:00It looks like this breaks on CF 11.
I have narrow...It looks like this breaks on CF 11.<br /><br />I have narrowed it down to something CF11 is putting in the request sent to Amazon, but I can't see anything weird when I dump the request ot the link...<br /><br />Anyone sort this out?Unknownhttps://www.blogger.com/profile/06018624977442704360noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-18181565365880875062010-04-21T18:38:03.986-05:002010-04-21T18:38:03.986-05:00My first thought is to get a new host. :)
A more u...My first thought is to get a new host. :)<br />A more useful approach would be searching / asking CF-Talk on http://www.houseoffusion.com/ <br />lots of helpful folks there.Phillyunhttps://www.blogger.com/profile/01128000798018366820noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-13039044426653845182010-04-21T18:23:18.018-05:002010-04-21T18:23:18.018-05:00That almost made it. But in the aaws.cfc you use 1...That almost made it. But in the aaws.cfc you use 1 createObject. If you could get rid of that then even people on hosts that block createobject and cfobject could use it.<br />Really trying to get around that problem. Any suggestions?DonOmitehttps://www.blogger.com/profile/18421539458285746220noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-34651010324814034442009-12-30T08:34:39.344-06:002009-12-30T08:34:39.344-06:00I ended up creating an hmac encoding cfc that simp...I ended up creating an hmac encoding cfc that simply wraps the java encoding objects. You can see it on pastebin for now:<br /><br />http://pastebin.com/f6e1ec14a<br /><br />DominicDomhttps://www.blogger.com/profile/01927539923118254718noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-60009215114040294662009-12-29T23:16:58.397-06:002009-12-29T23:16:58.397-06:00Great stuff. I've managed to get the hmac encr...Great stuff. I've managed to get the hmac encrytion working without the external code (using java objects instead). Feels much cleaner though only tested on Railo so far. Something like:<br /><br />// setup java encryption objects...<br />_secretKey = CreateObject('java', 'javax.crypto.spec.SecretKeySpec' ).Init(secretKey.GetBytes(), 'HmacSHA256');<br />_hmacEncryptor = CreateObject('java', "javax.crypto.Mac").getInstance("HmacSHA256");<br />_hmacEncryptor.init(_secretKey);<br /><br />//...<br /><br />// Genereate raw HMAC SHA-256 <br />raw = _hmacEncryptor.doFinal( stringToSign.GetBytes() );<br /> <br />// 4. base64 and url encode<br />Signature = Replace( Replace( ToBase64( raw ), '+', '%2B', 'all'), '=', '%3D', 'all');Domhttps://www.blogger.com/profile/01927539923118254718noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-80572876976754015842009-08-20T16:20:53.518-05:002009-08-20T16:20:53.518-05:00Thanks a ton! Your code worked great!Thanks a ton! Your code worked great!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-19426398113208497112009-08-18T15:24:32.857-05:002009-08-18T15:24:32.857-05:00@Jim... Sorry I was not clear in how I used Philly...@Jim... Sorry I was not clear in how I used Phillyun's CFC file.<br /><br />I have many different files accessing the CFC via the cfinvoke tag and passing arguments to it via cfinvokeargument tag's.<br /><br />I then changed: cfset local.urlPassed = to cfset Request.urlPassed = so I could use the returned variables in any file involved in the operation.<br /><br />You first have to instantiate the request scope variable urlPassed and then populate it to use it.<br /><br />I'm sure there is a more elegant way to do this, but I was up against the Aug. 15 deadline and had a lot of code to rewrite.Unknownhttps://www.blogger.com/profile/06018624977442704360noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-10780212824023905342009-08-18T11:46:47.775-05:002009-08-18T11:46:47.775-05:00When I try to CfHttp it I get:
Element URLPASSED ...When I try to CfHttp it I get:<br /><br />Element URLPASSED is undefined in REQUEST. <br /> <br /> <br />The error occurred in C:\websites\books2b\testaws.cfm: line 103<br /> <br />101 : <br />102 : <br />103 : cfhttp url="#Request.urlPassed#" method="get">Jimhttps://www.blogger.com/profile/03281068794881118350noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-85850737631240984842009-08-17T22:49:46.673-05:002009-08-17T22:49:46.673-05:00@Jeff Glad it worked out for you, where do I send ...@Jeff Glad it worked out for you, where do I send the bill? <br />Better yet, you help me out next time they add the next requirement.Phillyunhttps://www.blogger.com/profile/01128000798018366820noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-68743132830483149062009-08-17T21:05:01.326-05:002009-08-17T21:05:01.326-05:00Saved me hours of work. Kudos. :)Saved me hours of work. Kudos. :)GrubberGamerhttps://www.blogger.com/profile/05046143553799171537noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-13598379954733551312009-08-12T12:41:34.998-05:002009-08-12T12:41:34.998-05:00>>@westfork - last paragraph. :)
Thanks, do...>>@westfork - last paragraph. :)<br /><br />Thanks, don't know how I missed that.<br /><br />Nice code, it works beautifully.<br /><br />>>@ Mike - Have you got this working with cfhttp?<br /><br />Just change the local scope to the Request scope and call that.<br /><br /> cfhttp url="#Request.urlPassed#" method="get"Unknownhttps://www.blogger.com/profile/06018624977442704360noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-34133337342456963442009-08-12T07:31:20.713-05:002009-08-12T07:31:20.713-05:00Have you got this working with cfhttp?Have you got this working with cfhttp?Mikehttp://www.teamtool.netnoreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-12978522982631151242009-08-05T09:10:11.900-05:002009-08-05T09:10:11.900-05:00@westfork - last paragraph. :)@westfork - last paragraph. :)Phillyunhttps://www.blogger.com/profile/01128000798018366820noreply@blogger.comtag:blogger.com,1999:blog-8392508371021961521.post-31346763609616955702009-08-04T17:51:41.900-05:002009-08-04T17:51:41.900-05:00do you have any code examples you'd like to sh...do you have any code examples you'd like to show?Unknownhttps://www.blogger.com/profile/06018624977442704360noreply@blogger.com