Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not found "OAuth" and access_token on getAccessTokenParams() #15

Open
GoogleCodeExporter opened this issue Apr 8, 2016 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

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)

Original issue reported on code.google.com by dmousex on 13 Mar 2011 at 9:04

@GoogleCodeExporter
Copy link
Author

I can confirm, that this fixes the bug. I invested too many hours on this one…

Original comment by [email protected] on 16 May 2011 at 4:48

@GoogleCodeExporter
Copy link
Author

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*=?"?(.+)"?/'


Original comment by [email protected] on 1 Jun 2011 at 7:34

@GoogleCodeExporter
Copy link
Author

I also had to make both these changes to get it working.

Original comment by [email protected] on 19 Jan 2012 at 5:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant