Bug #16619 [Opn]: No params/headers from Consumer::getRequestToken()

From: Date: Wed, 16 Sep 2009 16:53:03 +0000
Subject: Bug #16619 [Opn]: No params/headers from Consumer::getRequestToken()
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-1656@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16619&edit=1 ID: 16619 Updated by: doug@rds.com Reported By: doug at rds dot com Summary: No params/headers from Consumer::getRequestToken() Status: Open Type: Bug Package: HTTP_OAuth Operating System: OS X 10.6 Package Version: 0.1.2 PHP Version: 5.3.0 Roadmap Versions: New Comment: debug: test: building Consumer request object (consumer_token=76f9751ece5a019c2f446cf0732dcaed, consumer_token_secret=22ffeab75f73e35c71182f78dcc59be1) debug: token is now: debug: token_secret is now: debug: test: asking for request_token debug: Getting request token from http://hay.cn.org/oauth/request_token debug: callback: http://hay.cn.org/oauth/test.php debug: signing request with: HMAC-SHA1 debug: Signing with base string: POST&http%3A%2F%2Fhay.cn.org%2Foauth%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Fhay.cn.org%252Foauth%252Ftest.php%26oauth_consumer_key%3D76f9751ece5a019c2f446cf0732dcaed%26oauth_nonce%3D383b9a45a4653f6df4b631c265d838a8%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1253115215%26oauth_version%3D1.0 debug: Signing with key: 22ffeab75f73e35c71182f78dcc59be1& debug: * Connected to tcp://hay.cn.org:80 debug: > POST /oauth/request_token HTTP/1.1 debug: > User-Agent: HTTP_Request2/0.4.0 (http://pear.php.net/package/http_request2) PHP/5.3.0 debug: > Authorization: OAuth realm="http://hay.cn.org/", oauth_callback="http%3A%2F%2Fhay.cn.org%2Foauth%2Ftest.php", oauth_consumer_key="76f9751ece5a019c2f446cf0732dcaed", oauth_nonce="383b9a45a4653f6df4b631c265d838a8", oauth_signature="Q702aOKK3HK0bhES%2Fj%2FlrMAhPxc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1253115215", oauth_version="1.0" debug: > Host: hay.cn.org debug: > Accept-Encoding: gzip, deflate debug: > Content-Length: 0 debug: > debug: < HTTP/1.1 200 OK debug: < date: Wed, 16 Sep 2009 15:33:35 GMT debug: < server: Apache/2.2.11 (Unix) DAV/2 PHP/5.3.0 debug: < x-powered-by: PHP/5.3.0 debug: < expires: Thu, 19 Nov 1981 08:52:00 GMT debug: < cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 debug: < pragma: no-cache debug: < content-length: 3001 debug: < content-type: text/html debug: < debug: Array ( [UNIQUE_ID] => SrEFT38AAAEAAGkYaH0AAAAH [SCRIPT_URL] => /oauth/request_token [SCRIPT_URI] => http://hay.cn.org/oauth/request_token [HTTP_USER_AGENT] => HTTP_Request2/0.4.0 (http://pear.php.net/package/http_request2) PHP/5.3.0 [HTTP_HOST] => hay.cn.org [HTTP_ACCEPT_ENCODING] => gzip, deflate [CONTENT_LENGTH] => 0 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache/2.2.11 (Unix) DAV/2 PHP/5.3.0 [SERVER_NAME] => hay.cn.org [SERVER_ADDR] => 127.0.0.1 [SERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /var/www/haystack [SERVER_ADMIN] => doug@rds.com [SCRIPT_FILENAME] => /var/www/haystack/oauth/request_token.php [REMOTE_PORT] => 49159 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /oauth/request_token [SCRIPT_NAME] => /oauth/request_token [PHP_SELF] => /oauth/request_token [REQUEST_TIME] => 1253115215 ) <br><br> Array ( ) <b>debug</b>: OAuth::request_token: processing request<br /> <b>debug</b>: Using apache_request_headers() to get request headers<br /> <b>debug</b>: Using OAuth data from header<br /> <b>debug</b>: getting data from POST<br /> <b>debug</b>: HTTP_OAuth_Provider_Request exception: <table border="1" cellspacing="0"><br /> <tr><td colspan="3" bgcolor="#ff9999"> <b>HTTP_OAuth_Provider_Exception_InvalidRequest</b>: Invalid content type for POST request in <b>/usr/local/PEAR/HTTP/OAuth/Provider/Request.php</b> on line <b>62</b></td></tr><br /> <tr><td colspan="3" bgcolor="#aaaaaa" align="center"><b>Exception trace</b></td></tr><br /> <tr><td align="center" bgcolor="#cccccc" width="20"><b>#</b></td><td align="center" bgcolor="#cccccc"><b>Function</b></td><td align="center" bgcolor="#cccccc"><b>Location</b></td></tr><br /> <tr><td align="center">0</td><td>HTTP_OAuth_Provider_Request->setParametersFromRequest()</td><td>/usr/local/PEAR/HTTP/OAuth/Provider/Request.php:62</td></tr><br /> <tr><td align="center">1</td><td>HTTP_OAuth_Provider_Request->__construct()</td><td>/private/var/www/haystack/classes/OAuth.php:326</td></tr><br /> <tr><td align="center">2</td><td>OAuth::request_token()</td><td>/private/var/www/haystack/oauth/request_token.php:30</td></tr><br /> <tr><td align="center">3</td><td>{main}</td><td>&nbsp;</td></tr><br /> </table><br /> debug: test: request for request_token failed HTTP_OAuth_Consumer_Exception_InvalidResponse: Failed getting token and token secret from response in /private/var/www/haystack/oauth/test.php on line 64 Exception trace # Function Location 0 HTTP_OAuth_Consumer->getRequestToken('http://hay.cn.or…', 'http://hay.cn.or…') /private/var/www/haystack/oauth/test.php:64 1 {main} Array ( [UNIQUE_ID] => SrEFT38AAAEAAGkYaH0AAAAH [SCRIPT_URL] => /oauth/request_token [SCRIPT_URI] => http://hay.cn.org/oauth/request_token [HTTP_USER_AGENT] => HTTP_Request2/0.4.0 (http://pear.php.net/package/http_request2) PHP/5.3.0 [HTTP_HOST] => hay.cn.org [HTTP_ACCEPT_ENCODING] => gzip, deflate [CONTENT_LENGTH] => 0 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache/2.2.11 (Unix) DAV/2 PHP/5.3.0 [SERVER_NAME] => hay.cn.org [SERVER_ADDR] => 127.0.0.1 [SERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /var/www/haystack [SERVER_ADMIN] => doug@rds.com [SCRIPT_FILENAME] => /var/www/haystack/oauth/request_token.php [REMOTE_PORT] => 49159 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /oauth/request_token [SCRIPT_NAME] => /oauth/request_token [PHP_SELF] => /oauth/request_token [REQUEST_TIME] => 1253115215 ) Array ( ) debug: OAuth::request_token: processing request debug: Using apache_request_headers() to get request headers debug: Using OAuth data from header debug: getting data from POST debug: HTTP_OAuth_Provider_Request exception: HTTP_OAuth_Provider_Exception_InvalidRequest: Invalid content type for POST request in /usr/local/PEAR/HTTP/OAuth/Provider/Request.php on line 62 Exception trace # Function Location 0 HTTP_OAuth_Provider_Request->setParametersFromRequest() /usr/local/PEAR/HTTP/OAuth/Provider/Request.php:62 1 HTTP_OAuth_Provider_Request->__construct() /private/var/www/haystack/classes/OAuth.php:326 2 OAuth::request_token() /private/var/www/haystack/oauth/request_token.php:30 3 {main} Previous Comments: ------------------------------------------------------------------------ [2009-09-16 17:49:06] dkaye Description: ------------ Although reported fixed in bug 16573, and I see the source-code change, I'm still not receiving a Content-Type header and there are no POST parameters received from Consumer::getRequestToken(). See attached debug output. Actual result: -------------- As received at Service Provider. Note CONTENT_LENGTH=0 and no CONTENT_TYPE: [SCRIPT_URL] => /oauth/request_token [HTTP_USER_AGENT] => HTTP_Request2/0.4.0 (http://pear.php.net/package/http_request2) PHP/5.3.0 [CONTENT_LENGTH] => 0 [REQUEST_METHOD] => POST [QUERY_STRING] => ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16619&edit=1

« previous php.pear.bugs (#1656) next »