sonimeister / oauth

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

Can't get a Request Token or Access Token with OAuthBase (C#) #198

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
(C#)  OAuthBase removes parameters that start with oauth_ in the 
GetQueryParameters method.

In GenerateSignatureBase() it adds the parameters needed for a protected 
resource request back.  It does not add other oauth parameters needed to get a 
Request Token or Access Token.  Specifically, it does not add oauth_verifier or 
oauth_callback.

As other libraries include these in the signature base (per the spec), the 
signature produced by OAuthBase for Access Token and Request Token requests do 
not agree with other libraries.

I solved this problem by adding these parameters to the various signature 
methods (see attached).

Please provide any additional information below.

Original issue reported on code.google.com by tom.e.os...@gmail.com on 6 Apr 2011 at 6:18

Attachments:

GoogleCodeExporter commented 8 years ago
I had the same problem with the oauth_verifier. The problem is a bug in the 
method GetQueryParameters: This condition discards every parameter that begins 
with oauth_:
if (!string.IsNullOrEmpty(s) && !s.StartsWith(OAuthParameterPrefix))
so there are never parameters returned.

This should work correct:
if (!string.IsNullOrEmpty(s) && s.StartsWith(OAuthParameterPrefix))

Original comment by flushdra...@googlemail.com on 27 Jun 2011 at 9:33