[英]Twitter OAUTH error curl related
我正在使用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。 所以在:
供應商/ HWI / OAuth的束/ HWI /捆綁/ OAuthBundle / 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',
));
至 :
$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',
));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.