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