Coder Social home page Coder Social logo

Comments (3)

themattharris avatar themattharris commented on July 29, 2024

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.

Scottjutsu avatar Scottjutsu commented on July 29, 2024

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.

themattharris avatar themattharris commented on July 29, 2024

Great, glad you got it working!

from tmhoauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.