Comments (7)
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.
Just in case it wasn't clear from the commit, the example lives at: examples/twittersingleuser/twitter.go
from oauth.
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.
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.
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.
@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.
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)
- Add more structure to errors HOT 3
- Using "UnixNano" as a random seed HOT 1
- Seems Twitter auth doesn't work without oob but with callback url HOT 2
- Unable to send tweet HOT 5
- RSA private key cannot be defined HOT 5
- broken request if parameter contains ";" HOT 4
- Verifying requests HOT 1
- Error reading privateKey HOT 2
- Would like to patch so that Oauth works with Yahoo. Preferred Way? HOT 8
- Space not properly escaped HOT 1
- Twitter example doesn't work HOT 1
- No license HOT 1
- Not working for Twitter
- Not able to make OAUTH Post call HOT 2
- The logic behind preventing multiple form parameters with same name. HOT 5
- HTTP/S Proxy Support HOT 2
- Consider merging with Gomniauth
- Renew access token HOT 1
- Return HTTP response to clients even on non 2XX responses. HOT 1
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 oauth.