Hello!
I'm trying to write an OAuth 1 REST client using RestSharp, and I'm
running into some invalid signature problems with GET requests. I
stepped through the code, and it seems the problem is that, for GET
requests, the request parameters are omitted from the signature base
string. In particular, the offending code in OAuth1Authenticator.cs is
this:
// for non-GET style requests make sure params are part of oauth
signature
if (request.Method != Method.GET && request.Method != Method.DELETE)
{
foreach (var p in request.Parameters.Where(p => p.Type ==
ParameterType.GetOrPost))
{
parameters.Add(new WebPair(p.Name, p.Value.ToString()));
}
}
If I remove the if statement, it works as expected.
Am I misunderstanding something? Based on the signature base string
example in the OAuth spec here:
http://oauth.net/core/1.0a/#sig_base_example,
it looks like it should be adding these parameters to the base
signature. Is this a bug in the OAuth1Authenticator, or am I doing
something wrong?
Thank you!
Rhys