Skip to content

getAccessTokenParam can get oauth_token from header #21

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions