Account/verify_credentials


#1

Anybody knows what is worg in this url ??

I’m trying to grant access registering user to website but this returns [error] => Could not authenticate you.

https://api.twitter.com/1/account/verify_credentials.json?oauth_consumer_key=5OQZLG6NTau8y5VNWG6cPw&oauth_nonce=a8f34ef63e0cb00f25e92d1bf6bcd757&oauth_signature=DlcaoctvQ3OLghEf4LHy8gJ9ffU%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1316013157&oauth_token=w4wAfScbBie4DbEu8dWtOClDN7sXn9Rs8bxSn9ylc&oauth_version=1.0

thanks!

here variable data:

connection:

TwitterOAuth Object
(
[http_code] => 401
[url] => https://api.twitter.com/1/account/verify_credentials.json?oauth_consumer_key=5OQZLG6NTau8y5VNWG6cPw&oauth_nonce=a8f34ef63e0cb00f25e92d1bf6bcd757&oauth_signature=DlcaoctvQ3OLghEf4LHy8gJ9ffU%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1316013157&oauth_token=w4wAfScbBie4DbEu8dWtOClDN7sXn9Rs8bxSn9ylc&oauth_version=1.0
[host] => https://api.twitter.com/1/
[timeout] => 30
[connecttimeout] => 30
[ssl_verifypeer] =>
[format] => json
[decode_json] => 1
[http_info] => Array
(
[url] => https://api.twitter.com/1/account/verify_credentials.json?oauth_consumer_key=5OQZLG6NTau8y5VNWG6cPw&oauth_nonce=a8f34ef63e0cb00f25e92d1bf6bcd757&oauth_signature=DlcaoctvQ3OLghEf4LHy8gJ9ffU%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1316013157&oauth_token=w4wAfScbBie4DbEu8dWtOClDN7sXn9Rs8bxSn9ylc&oauth_version=1.0
[content_type] => application/json; charset=utf-8
[http_code] => 401
[header_size] => 858
[request_size] => 392
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 3.646085
[namelookup_time] => 2.4E-5
[connect_time] => 3.156793
[pretransfer_time] => 3.483975
[size_upload] => 0
[size_download] => 355
[speed_download] => 97
[speed_upload] => 0
[download_content_length] => 355
[upload_content_length] => 0
[starttransfer_time] => 3.646069
[redirect_time] => 0
[certinfo] => Array
(
)

    )

[useragent] => TwitterOAuth v0.2.0-beta2
[sha1_method] => OAuthSignatureMethod_HMAC_SHA1 Object
    (
    )

[consumer] => OAuthConsumer Object
    (
        [key] => 5OQZLG6NTau8y5VNWG6cPw
        [secret] => TgForkIuzPUnKC2aXXXXalwJOdgtmwBxiArYgXlJvyk
        [callback_url] => 
    )

[token] => OAuthConsumer Object
    (
        [key] => w4wAfScbBie4DbEu8dWtOClDN7sXn9Rs8bxSn9ylc
        [secret] => Fc6YSZd0gY5Ss3XXXXXXB6emb1Xjm4b3TqmVaIpX1Fmk
        [callback_url] => 
    )

[http_header] => Array
    (
        [date] => Wed, 14 Sep 2011 15:12:41 GMT
        [server] => hi
        [status] => 401 Unauthorized
        [www_authenticate] => OAuth realm="https://api.twitter.com"
        [x_runtime] => 0.00235
        [content_type] => application/json; charset=utf-8
        [content_length] => 355
        [cache_control] => no-cache, max-age=300
        [set_cookie] => _twitter_sess=BAh7CDoHaWQiJWE0ZTXXXXZDdhOWE0NjA4YjFkNTQxM2Q1Igpm%250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG%250AOgpAdXNlZHsAOg9jcmVhdGVkX2F0bCsIiTp%252FaDIB--199a4c7cccd82a51d5e177eb7a0a437dd83b26ee; domain=.twitter.com; path=/; HttpOnly
        [expires] => Wed, 14 Sep 2011 15:17:41 GMT
        [vary] => Accept-Encoding
    )

)


#2

Aside from whatever issues you’re experiencing, you’ll want to regenerate your API keys and secret as soon as possible. Within the variable dump you left, your key secrets were visible – I’ve obfuscated them for you now.

On to your issue:
The oauth_token being used in this request on account/verify_credentials looks like a request token and not an access token. Are you using the right set of variables?


#3

Thanks, I have regenerated the keys again. requestToken and accesToken are what OAuth returns.


#4

you are a genius… I have been jacking with this for a month!!!

"Are you using the right set of variables? " - lol

Wow! Thanks sooo much!


#5

I am also getting this error when i am using it in cakephp. Can anyone please help me. I have regenerated the key also
url for getting json is: https://twitter.com/account/verify_credentials.json
but response is like this
{“error”:“Could not authenticate you.”,“request”:"/account/verify_credentials.json"}


#6

i am also getting {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]} when calling protected resource https://api.twitter.com/1.1/account/verify_credentials.json . please help me