xuelang3hui / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

C# Double encode #206

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use PLAINTEXT
2. Test with http://term.ie/oauth/example/?sig_method=PLAINTEXT

What is the expected output? 
oauth_signature=secret%2526
What do you see instead?
oauth_signature=secret%26

Solution in the method GenerateSignature

case SignatureTypes.PLAINTEXT:
var firstEncode = HttpUtility.UrlEncode(string.Format("{0}&{1}", 
consumerSecret, tokenSecret));
return HttpUtility.UrlEncode(firstEncode);

Original issue reported on code.google.com by fabiomaulo on 24 Jun 2011 at 4:08

GoogleCodeExporter commented 8 years ago
Please forget it!!
It is done when I use HttpUtility.UrlEncode for each parameter instead use the 
returned value directly.
Sorry.

Original comment by fabiomaulo on 24 Jun 2011 at 7:26