Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php TwitterOAuth错误与卷曲相关_Php_Symfony_Oauth - Fatal编程技术网

Php TwitterOAuth错误与卷曲相关

Php TwitterOAuth错误与卷曲相关,php,symfony,oauth,Php,Symfony,Oauth,我正在使用symfony2和HWIOAuthBundle 当我试图通过OAUTH使用twitter id登录时 出现这些错误日志 有了谷歌帐号,我可以正常登录 我不知道会发生什么 有人给我一个暗示吗 The requested URL returned error: 403 in /Users/whitebear/httproot/twittest/vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php at line 29 -

我正在使用symfony2和HWIOAuthBundle

当我试图通过OAUTH使用twitter id登录时

出现这些错误日志

有了谷歌帐号,我可以正常登录

我不知道会发生什么

有人给我一个暗示吗

The requested URL returned error: 403


in /Users/whitebear/httproot/twittest/vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php at line 29   -
            $errorMsg = curl_error($this->lastCurl);
            $errorNo  = curl_errno($this->lastCurl);
            throw new ClientException($errorMsg, $errorNo);
        }
        static::populateResponse($this->lastCurl, $data, $response);
at Curl ->send (object(Request), object(Response)) 

in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/OAuth/ResourceOwner/AbstractResourceOwner.php at line 237   + 
at AbstractResourceOwner ->httpRequest ('http://api.twitter.com/1.1/account/verify_credentials.json', null, array('Authorization: OAuth realm="", oauth_consumer_key="GqoHwIFiNP089GUN3KXWA", oauth_timestamp="1389732011", oauth_nonce="ea571baabf373ef2570933df8d4ef23b", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_token="446279034-t1mwrxA9NjQdcqhNdQDruJVdtoJ4RlzcW1z24Kxz", oauth_signature="rYj43MDpu5m49JDEOjD92zDodmo%3D"'), null) 
in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php at line 192   + 
at GenericOAuth1ResourceOwner ->httpRequest ('http://api.twitter.com/1.1/account/verify_credentials.json', null, array('oauth_consumer_key' => 'GqoHwIFiNP089GUN3KXWA', 'oauth_timestamp' => '1389732011', 'oauth_nonce' => 'ea571baabf373ef2570933df8d4ef23b', 'oauth_version' => '1.0', 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_token' => '446279034-t1mwrxA9NjQdcqhNdQDruJVdtoJ4RlzcW1z24Kxz', 'oauth_signature' => 'rYj43MDpu5m49JDEOjD92zDodmo=')) 
in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php at line 208   + 
at GenericOAuth1ResourceOwner ->doGetUserInformationRequest ('http://api.twitter.com/1.1/account/verify_credentials.json', array('oauth_consumer_key' => 'GqoHwIFiNP089GUN3KXWA', 'oauth_timestamp' => '1389732011', 'oauth_nonce' => 'ea571baabf373ef2570933df8d4ef23b', 'oauth_version' => '1.0', 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_token' => '446279034-t1mwrxA9NjQdcqhNdQDruJVdtoJ4RlzcW1z24Kxz', 'oauth_signature' => 'rYj43MDpu5m49JDEOjD92zDodmo=')) 
in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php at line 52   + 
at GenericOAuth1ResourceOwner ->getUserInformation (array('oauth_token' => '446279034-t1mwrxA9NjQdcqhNdQDruJVdtoJ4RlzcW1z24Kxz', 'oauth_token_secret' => 'rVlo3UVInjQcdtcxEQfebpohxzsq3FcV3SSzTPdXrU', 'user_id' => '446279034', 'screen_name' => 'nandemobest10')) 
in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/Security/Core/Authentication/Provider/OAuthProvider.php at line 73   + 
at OAuthProvider ->authenticate (object(OAuthToken)) 
in kernel.root_dir/cache/dev/classes.php at line 4256   + 
at AuthenticationProviderManager ->authenticate (object(OAuthToken)) 
in /Users/whitebear/httproot/twittest/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/Security/Http/Firewall/OAuthListener.php at line 97  + 
at OAuthListener ->attemptAuthentication (object(Request)) 
in /Users/whitebear/httproot/twittest/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php at line 137   + 
at AbstractAuthenticationListener ->handle (object(GetResponseEvent)) 
in kernel.root_dir/cache/dev/classes.php at line 4133   + 
at Firewall ->onKernelRequest (object(GetResponseEvent)) 
at call_user_func (array(object(Firewall), 'onKernelRequest'), object(GetResponseEvent)) 
in /Users/whitebear/httproot/twittest/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php at line 451   + 
at TraceableEventDispatcher ->Symfony\Component\HttpKernel\Debug\{closure} (object(GetResponseEvent)) 
at call_user_func (object(Closure), object(GetResponseEvent)) 
in kernel.root_dir/cache/dev/classes.php at line 3473   + 
at EventDispatcher ->doDispatch (array(object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure)), 'kernel.request', object(GetResponseEvent)) 
in kernel.root_dir/cache/dev/classes.php at line 3406   + 
at EventDispatcher ->dispatch ('kernel.request', object(GetResponseEvent)) 
in kernel.root_dir/cache/dev/classes.php at line 3570   + 
at ContainerAwareEventDispatcher ->dispatch ('kernel.request', object(GetResponseEvent)) 
in /Users/whitebear/httproot/twittest/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php at line 139   + 
at TraceableEventDispatcher ->dispatch ('kernel.request', object(GetResponseEvent)) 
in kernel.root_dir/bootstrap.php.cache at line 991   + 
at HttpKernel ->handleRaw (object(Request), '1') 
in kernel.root_dir/bootstrap.php.cache at line 976   + 
at HttpKernel ->handle (object(Request), '1', true) 
in kernel.root_dir/bootstrap.php.cache at line 1101   + 
at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
in kernel.root_dir/bootstrap.php.cache at line 411   + 
at Kernel ->handle (object(Request)) 
in /Users/whitebear/httproot/twittest/web/app_dev.php at line 26

自1月14日起,您必须使用https。因此:

vendor/hwi/oauth bundle/hwi/bundle/oauth bundle/oauth/ResourceOwner/TwitterResourceOwner.php

将infos_url更改为https:

$resolver->setDefaults(array(
            'authorization_url' => 'https://api.twitter.com/oauth/authenticate',
            'request_token_url' => 'https://api.twitter.com/oauth/request_token',
            'access_token_url'  => 'https://api.twitter.com/oauth/access_token',
            'infos_url'         => 'http://api.twitter.com/1.1/account/verify_credentials.json',
        ));
致:


谢谢,我能解决这个问题。我只是想知道为什么这个错误会突然出现。HWIOAuthBundle尚未更新。请查看:。HWIOAuthBundle需要更新为“…”
$resolver->setDefaults(array(
        'authorization_url' => 'https://api.twitter.com/oauth/authenticate',
        'request_token_url' => 'https://api.twitter.com/oauth/request_token',
        'access_token_url'  => 'https://api.twitter.com/oauth/access_token',
        'infos_url'         => 'https://api.twitter.com/1.1/account/verify_credentials.json',
    ));