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

getAccessTokenParam can get oauth_token from header #21

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

getAccessTokenParam can get oauth_token from header #21

GoogleCodeExporter opened this issue Apr 8, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Get access token from oauth server
2. curl --header 'Authorization: OAuth oauth_token="my_token"' 
"my.api-server.com"
3. it will return error "Auth header found that doesn\'t start with "OAuth""

version: oauth2-php-23.tar.gz

Please provide any additional information below.

maybe because of at file OAuth2.php

line 951, change 

``if (strcmp(substr($auth_header, 0, 5), "OAuth ") !== 0)''

to 

``if (strcmp(substr($auth_header, 0, 6), "OAuth ") !== 0)''

and line 955, change

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

to 
``if (preg_match('/\s*oauth_token\s*="([^"]+)"/', $auth_header, $matches) == 0 
|| count($matches) < 2)''


Original issue reported on code.google.com by [email protected] on 7 Dec 2011 at 10:03

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