My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 15: Not found "OAuth" and access_token on getAccessTokenParams()
5 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by dmousex, Mar 13, 2011
Test with server pdo

http://pastebin.com/SVmJiJ3T

//not found the string "OAuth"
if (strcmp(substr($auth_header, 0, 5), "OAuth ") !== 0)

//patch
if (strcmp(substr($auth_header, 0, 5), "OAuth") !== 0)

//not found access_token value
if (preg_match('/\s*OAuth\s*="(.+)"/', substr($auth_header, 5), $matches) == 0 || count($matches) < 2)

//path
if (preg_match('/OAuth\s.*="(.+)"/', $auth_header, $matches) == 0 || count($matches) < 2)

May 16, 2011
#1 jens.k...@gmail.com
I can confirm, that this fixes the bug. I invested too many hours on this one…
Jun 1, 2011
#2 jess...@gmail.com
Since I'm implementing a server now, one comment on the 2nd patch:

//path
if (preg_match('/OAuth\s.*="(.+)"/', $auth_header, $matches) == 0 || count($matches) < 2)

From what I can see from the specs, that's the format for OAuth 1.0 headers and this should actually be (just the regex):


'/\s*OAuth\s*(.+)/'

If we wanted (half-assed) backwards compatibility, then this works:

'/\s*OAuth\s*=?"?(.+)"?/'


Jan 18, 2012
#3 relayers...@gmail.com
I also had to make both these changes to get it working.

Powered by Google Project Hosting