xiaoxiwu / devdefined-tools

Automatically exported from code.google.com/p/devdefined-tools
0 stars 0 forks source link

TimeZone Encryption issue #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
I'm using DevDefined.OAuth .Net APIs for authorization. I went thru few forums 
and understand that if content-type = "application/x-www-form-urlencoded", then 
request body should be passed for signing. My request body will have current 
system time.

CreateTime :BEFORE: 2012-02-09T00:00:00-08:00

While signing, this is encrypted as 
"CreateTime%20%3ABEFORE%3A%202012-02-09T00%3A00%3A00-08%3A00", and my service 
request is working perfectly. However when I try to use any timezone which have 
"+" symbol [ ex : UTC + 05:00 ] i'm getting "signature_invalid" exception 
message.

The reason behind is "+" sign is encrypted as "%2B", but "-" is NOT encrypted.

Original Request Body : CreateTime :BEFORE: 2012-02-09T00:00:00-08:00
Encrypted string  :CreateTime%20%3ABEFORE%3A%202012-02-09T00%3A00%3A00-08%3A00
Result : Working fine.

Original Request Body : CreateTime :BEFORE: 2012-02-09T00:00:00+05:00
Encrypted string  :CreateTime%20%3ABEFORE%3A%202012-02-09T00%3A00%3A00%2B05%3A00
Result : "signature_invalid" exception.

Any help?

Original issue reported on code.google.com by vaa...@gmail.com on 9 Feb 2012 at 11:37