php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64973 OAuth does not support multiple parameters of the same name
Submitted: 2013-06-05 01:52 UTC Modified: -
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: davidshumway at gmail dot com Assigned:
Status: Open Package: oauth (PECL)
PHP Version: 5.4.15 OS: Fedora 17
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: davidshumway at gmail dot com
New email:
PHP Version: OS:

 

 [2013-06-05 01:52 UTC] davidshumway at gmail dot com
Description:
------------
The specific request is for linkedin.com. It is 
http://api.linkedin.com/v1/company-search?
sort=relevance&facet=location,us:84&facet=industry,4. The two instances of 
"facet" are supposed to be supported.

The response returned is:
Error: Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)
Response: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
  <status>401</status>
  <timestamp>1370387652196</timestamp>
  <request-id>[redacted]</request-id>
  <error-code>0</error-code>
  <message>[unauthorized]. OAU:[redacted]</message>
</error>



#php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      /etc/php.d/curl.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/json.ini,
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/oauth.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_mysql.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/pspell.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/zip.ini

#php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
mhash
mysql
mysqli
OAuth
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
pspell
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xml
zip
zlib

Test script:
---------------
// This is a simple request to linkedin.com's API. An API key is required.

$consumer_key = '<enter a key>';
$consumer_secret = '<enter a key>';

$o = new OAuth($consumer_key, $consumer_secret);

$o->setToken('<enter a key>', '<enter a key>');

$url = 'http://api.linkedin.com/v1/company-search?sort=relevance&facet=location,us:84&facet=industry,4';

echo $o->fetch( $url );

Expected result:
----------------
The request is supposed to complete successfully.

Actual result:
--------------
The response returned is:
Error: Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)
Response: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
  <status>401</status>
  <timestamp>1370387652196</timestamp>
  <request-id>[redacted]</request-id>
  <error-code>0</error-code>
  <message>[unauthorized]. OAU:[redacted]</message>
</error>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-02 09:11 UTC] a dot skobeltsyn at gmail dot com
Hi,
i think i found the solution:
Put your facet params in array $params like:
$params = array(
"facet" => array("location,us:84","industry,4'");
}

and then put this $params into fetch args:
$res_fetch=$oauth->fetch($url, $params, OAUTH_HTTP_METHOD_GET,array('x-li-
format' => 'json'));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 19:01:32 2024 UTC