ZF2-267: PHP 5.4 + Zend GDATA + YouTube + OAuth Consumer => No Request Token

Issue Type: Bug Created: 2012-04-15T21:12:58.000+0000 Last Updated: 2012-04-15T21:41:57.000+0000 Status: Resolved Fix version(s): Reporter: Christoph Brosdau (boredom1) Assignee: Christoph Brosdau (boredom1) Tags: - Zend\Gdata

  • Zend\Oauth
  • GData
  • OAuth

Related issues: Attachments:


  • we want to create a youtube connection via OAuth (as on PHP 5.2 and ZF 1.11):


$this->oauthoptions = array( 'requestScheme' => \Zend\OAuth\OAuth::REQUEST_SCHEME_HEADER, 'version' => '1.0', 'consumerKey' => self::GOOGLEAPI_KEY, 'consumerSecret' => self::GOOGLEAPI_SECRET, 'signatureMethod' => 'HMAC-SHA1', 'callbackUrl' => self::CALLBACK_URL, 'requestTokenUrl' => '', 'userAuthorizationUrl' => '', 'accessTokenUrl' => '' ); $this->consumer=new \Zend\OAuth\Consumer($this->oauthoptions);

  • this should then lead to RequestTokens: $this->consumer->getRequestToken(array('scope' => ''));

BUT the following is the result:

ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/OAuth.php -> Zend\OAuth\OAuth ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Consumer.php -> Zend\OAuth\Consumer ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Config/StandardConfig.php -> Zend\OAuth\Config\StandardConfig ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Config.php -> Zend\OAuth\Config ZEND AUTOLOAD: .../libraries/gdata/Zend/Uri/UriFactory.php -> Zend\Uri\UriFactory ZEND AUTOLOAD: .../libraries/gdata/Zend/Uri/Uri.php -> Zend\Uri\Uri ZEND AUTOLOAD: .../libraries/gdata/Zend/Uri/Http.php -> Zend\Uri\Http ZEND AUTOLOAD: .../libraries/gdata/Zend/Validator/Hostname.php -> Zend\Validator\Hostname ZEND AUTOLOAD: .../libraries/gdata/Zend/Validator/AbstractValidator.php -> Zend\Validator\AbstractValidator ZEND AUTOLOAD: .../libraries/gdata/Zend/Validator/Validator.php -> Zend\Validator\Validator ZEND AUTOLOAD: .../libraries/gdata/Zend/Validator/Ip.php -> Zend\Validator\Ip ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Http/UserAuthorization.php -> Zend\OAuth\Http\UserAuthorization ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Http.php -> Zend\OAuth\Http ZEND AUTOLOAD: .../libraries/gdata/Zend/OAuth/Http/Utility.php -> Zend\OAuth\Http\Utility Fatal error: Call to a member function getToken() on a non-object in ....libraries/gdata/Zend/OAuth/Http/UserAuthorization.php on line 60

and actually, the reason is /Zend/OAuth/Http/UserAuthorization: -> _consumer->getLastRequestToken() returns NULL, so everything else failed.

public function assembleParams() { $params = array( 'oauth_token' => $this->_consumer->getLastRequestToken()->getToken(), ); ... return $params; }

Thanks for your Efforts! Christoph, Germany


Posted by Christoph Brosdau (boredom1) on 2012-04-15T21:41:57.000+0000

problem found. double call of getRequestTokens.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.