The twitter-oauth app uses the mrjones/oauth
library to demonstrate:
Here are the contents of the app:
twitter-oauth/app/
models
user.go # User struct and in-memory data store
controllers
app.go # All code
The OAuth process is governed by this configuration:
var TWITTER = oauth.NewConsumer( "VgRjky4dTA1U2Ck16MmZw", "l8lOLyIF3peCFEvrEoTc8h4oFwieAFgPM6eeTRo30I", oauth.ServiceProvider{ AuthorizeTokenUrl: "https://api.twitter.com/oauth/authorize", RequestTokenUrl: "https://api.twitter.com/oauth/request_token", AccessTokenUrl: "https://api.twitter.com/oauth/access_token", }, )
Here’s an overview of the process: