Git Product home page Git Product logo

Comments (7)

kennygrant avatar kennygrant commented on June 4, 2024 1

It does work if you have the tokens already issued via another method - I've been using it that way during testing. The urls wouldn't matter in that case, just call oauth.NewConsumer, then oauth.AccessToken, then MakeHttpClient and use the client to make your request.

from oauth.

mrjones avatar mrjones commented on June 4, 2024 1

Just in case it wasn't clear from the commit, the example lives at: examples/twittersingleuser/twitter.go

from oauth.

trosel avatar trosel commented on June 4, 2024

If you don't mind, could you add a quick twitter example to the readme that shows that? Twitter is a common example where they give you all 4 keys right away.

from oauth.

kennygrant avatar kennygrant commented on June 4, 2024

I'm not the original author, post a question on stack overflow and I can answer it there with an example (or someone else will I'm sure).

from oauth.

mrjones avatar mrjones commented on June 4, 2024

I created an example, which I demonstrates how to make a request given all of: {consumer key, consumer secret, access token, access token secret}.

I think this is what you were looking for, so I'm going to close this issue. Please let me know if I misunderstood or if you have any other questions!

from oauth.

trosel avatar trosel commented on June 4, 2024

@mrjones Is the oauth.serviceProvider required? What if we don't have that? Can we put dummy values in? https://github.com/mrjones/oauth/blob/httpbody/examples/twittersingleuser/twitter.go#L66

from oauth.

mrjones avatar mrjones commented on June 4, 2024

I might be misunderstanding the question, but: Yes, serviceProvider is required.

In particular the RequestTokenUrl, AuthorizeTokenUrl and AccessTokenUrl fields are very important. (HttpMethod, BodyHash, IgnoreTimestamp and SignQueryParams can be ignored. They are tweaks to enable communicate with non-standard OAuth endpoints).

These three URLs (RequestTokenUrl, AuthorizeTokenUrl and AccessTokenUrl) are part of the specification of any OAuth API. So, the API documentation should provide them somewhere. https://github.com/mrjones/oauth/blob/httpbody/oauth.go has some examples.

If there's a particular API you're having trouble figuring out the URLs for, let me know and I can take a look.

from oauth.

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.