Comments (3)
Hey cypherD,
For question 1, make sure the token and secret are valid for the user you are making requests on behalf. For testing you can find out your own on dev.twitter.com/apps - and yeah the 150 limit means it considers you unauthenticated.
For question 2, the correct endpoint is https://api.twitter.com/1/account/verify_credentials.json (without the username) (doc: https://dev.twitter.com/docs/api/1/get/account/verify_credentials).
As you are getting the error "Could not authenticate with OAuth" and also "expired token" i'm pretty certain the issue is either incorrect or temporary tokens are being passed in your requests. The best thing to do here is copy your own token/secret from dev.twitter.com/apps and see if that works. If it does, you know something is wrong in the way you obtain or store the user tokens in the the live app.
Some of the API endpoints on the Twitter API will default to unauthenticated if the credentials you are sending are invalid. If this happens there will be a header X-Warning
added to the response which you can inspect by doing var_dump($tmhOAuth->response['headers']);
. If the credentials were bad the header will read:
x_warning: Invalid OAuth credentials detected
I think this is why the token is allowing you to access the 10 favorite tweets (unauthenticated) but doesn't allow you to access protected 'authenticated only' resources.
Let me know how you get along with the token/secret from dev.twitter.com/apps
from tmhoauth.
Spot on. It seems I tripped up somewhere among all of the steps of the 'OAuth dance', as you aptly put it. Thanks so much!
from tmhoauth.
Great, glad you got it working!
from tmhoauth.
Related Issues (20)
- Wrong username password warning if user isn't logged in HOT 1
- update_profile_background_image not updating the bg image (Not a library issue) HOT 1
- 401 Error HOT 1
- error with PHP 5.3 HOT 6
- Using proxies HOT 1
- curl_setopt(): The usage of the @filename API for file uploading is deprecated HOT 2
- 'geocode' parameter doesn't seem to work for search/tweets.json HOT 3
- Auth problems HOT 3
- Not updating image: update_profile_background_image
- php5.6 HOT 11
- Getting an image of original tweet author
- Deprecated "curl_setopt" error on PHP 5.5.24
- Response code 0. HOT 1
- Support for Upload Videos/ Gifs HOT 8
- No composer install instructions HOT 1
- Post with Json
- Parameters for direct message on twitter
- Parameters for direct message on twitter HOT 4
- Rate limiting headers HOT 1
- DELETE requests return HTTP 401: 32 - "Could not authenticate you"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmhoauth.