trying to use new tmhOAuth and replaced my old one then set version to 1.1.
After that i edited code in my php and changed user_token to token and user_secret to secret.
Page goes to twitter login then after redirecting to website then user this code $code = $tmhOAuth->user_request(array('url' => $tmhOAuth->url('1.1/account/verify_credentials')));
It gets error getting error bad authentication didn't happen in 1.0 version before. here is the twitter response:
Error: {"errors":[{"message":"Bad Authentication data","code":215}]}
tmhOAuth Object
(
[response] => Array
(
[raw] => HTTP/1.1 400 Bad Request
content-type: application/json; charset=utf-8
date: Mon, 17 Jun 2013 04:18:33 UTC
server: tfe
set-cookie: guest_id=v1%3A137144271317108052; Domain=.twitter.com; Path=/; Expires=Wed, 17-Jun-2015 04:18:33 UTC
strict-transport-security: max-age=631138519
Transfer-Encoding: chunked
Content-Encoding: gzip
{"errors":[{"message":"Bad Authentication data","code":215}]}
[headers] => Array
(
[HTTP/1.1 400 Bad Request] =>
[content-type] => application/json; charset=utf-8
[date] => Mon, 17 Jun 2013 04:18:33 UTC
[server] => tfe
[set-cookie] => guest_id=v1%3A137144271317108052; Domain=.twitter.com; Path=/; Expires=Wed, 17-Jun-2015 04:18:33 UTC
[strict-transport-security] => max-age=631138519
[Transfer-Encoding] => chunked
[Content-Encoding] => gzip
[] =>
)
[code] => 400
[response] => {"errors":[{"message":"Bad Authentication data","code":215}]}
[info] => Array
(
[url] => https://api.twitter.com/1.1/account/verify_credentials.json
[content_type] => application/json; charset=utf-8
[http_code] => 400
[header_size] => 337
[request_size] => 442
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 3.135
[namelookup_time] => 0.093
[connect_time] => 0.53
[pretransfer_time] => 2.621
[size_upload] => 0
[size_download] => 86
[speed_download] => 27
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 3.135
[redirect_time] => 0
[certinfo] => Array
(
)
[primary_ip] => 199.59.150.9
[primary_port] => 443
[local_ip] => 192.168.20.103
[local_port] => 52016
[redirect_url] =>
[request_header] => GET /1.1/account/verify_credentials.json HTTP/1.1
User-Agent: tmhOAuth 0.8.2+SSL - //github.com/themattharris/tmhOAuth
Host: api.twitter.com
Accept: /
Accept-Encoding: deflate, gzip
Authorization: OAuth oauth_consumer_key="whXGehzgX72Jnz6VOwXVBg", oauth_nonce="c3c2f3adde1b18704f267ff8fbffb567", oauth_signature="IeSgCdyRjgJXSvJbfohJxRXGv6Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1371442710", oauth_version="1.1"
)
[error] =>
[errno] => 0
)
[buffer] =>
[config] => Array
(
[user_agent] => tmhOAuth 0.8.2+SSL - //github.com/themattharris/tmhOAuth
[host] => api.twitter.com
[consumer_key] => whXGehzgX72Jnz6VOwXVBg
[consumer_secret] => iGXrfjiJ9iyuqMYz1Ild6KHhnpJ9xhqfq7NoiEdtZU
[token] =>
[secret] =>
[bearer] =>
[oauth_version] => 1.1
[oauth_signature_method] => HMAC-SHA1
[curl_connecttimeout] => 30
[curl_timeout] => 10
[curl_ssl_verifyhost] => 2
[curl_ssl_verifypeer] => 1
[use_ssl] => 1
[curl_cainfo] => D:\xampp\htdocs\photolivedesktop\application\libraries\twitter\cacert.pem
[curl_capath] => D:\xampp\htdocs\photolivedesktop\application\libraries\twitter
[curl_followlocation] =>
[curl_proxy] =>
[curl_proxyuserpwd] =>
[curl_encoding] =>
[is_streaming] =>
[streaming_eol] =>
[streaming_metrics_interval] => 10
[as_header] => 1
[force_nonce] =>
[force_timestamp] =>
)
[request_settings] => Array
(
[params] => Array
(
)
[headers] => Array
(
[Authorization] => OAuth oauth_consumer_key="whXGehzgX72Jnz6VOwXVBg", oauth_nonce="c3c2f3adde1b18704f267ff8fbffb567", oauth_signature="IeSgCdyRjgJXSvJbfohJxRXGv6Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1371442710", oauth_version="1.1"
)
[with_user] => 1
[multipart] =>
[method] => GET
[without_bearer] =>
[url] => https://api.twitter.com/1.1/account/verify_credentials.json
[oauth1_params] => Array
(
[oauth_consumer_key] => whXGehzgX72Jnz6VOwXVBg
[oauth_nonce] => c3c2f3adde1b18704f267ff8fbffb567
[oauth_signature] => IeSgCdyRjgJXSvJbfohJxRXGv6Q%3D
[oauth_signature_method] => HMAC-SHA1
[oauth_timestamp] => 1371442710
[oauth_version] => 1.1
)
[prepared_params] => Array
(
)
[basestring_params] => oauth_consumer_key=whXGehzgX72Jnz6VOwXVBg&oauth_nonce=c3c2f3adde1b18704f267ff8fbffb567&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1371442710&oauth_version=1.1
[basestring] => GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Faccount%2Fverify_credentials.json&oauth_consumer_key%3DwhXGehzgX72Jnz6VOwXVBg%26oauth_nonce%3Dc3c2f3adde1b18704f267ff8fbffb567%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1371442710%26oauth_version%3D1.1
[signing_key] => iGXrfjiJ9iyuqMYz1Ild6KHhnpJ9xhqfq7NoiEdtZU&
)
)
Can someone tell me what I am doing wrong?
Thanks