edithau / oauth

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

to_header() authorization type fix proposal #161

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

OAuthRequest.to_header() produces a header like this:
Authorization: OAuth,oauth_version="1.0", ...etc....

The problem is that OAuth is not recognized everywhere as Authorization
type (it doesn't work at LinkedIn for example, who reports "Unknown
authorization header")

Proposed fix is to add a whitespace between "Authorization: OAuth" and
",oauth_version ...." in to_header(), resulting in this code:

  public function to_header($realm=null) {
    if($realm)
      $out = 'Authorization: OAuth realm="' .
OAuthUtil::urlencode_rfc3986($realm) . '" ';
    else
      $out = 'Authorization: OAuth ';

....etc..

Original issue reported on code.google.com by mdo...@gmail.com on 6 May 2010 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by morten.f...@gmail.com on 7 May 2010 at 3:21

GoogleCodeExporter commented 9 years ago
Okay, so you're saying that 

Authorization: OAuth,oauth_version="1.0", ...

needs to be

Authorization: OAuth ,oauth_version="1.0", ...

Correct?

Shouldn't it rather be

Authorization: OAuth oauth_version="1.0", ...

That is - added space and no comma in front of oauth_version?

Original comment by morten.f...@gmail.com on 12 Jun 2010 at 8:39