top

Package oauth is consumer interface for OAuth 1.0, OAuth 1.0a and RFC 5849.

Redirection-based Authorization

This section outlines how to use the oauth package in redirection-based authorization (http://tools.ietf.org/html/rfc5849#section-2).

Step 1: Create a Client using credentials and URIs provided by the server. The Client can be initialized once at application startup and stored in a package-level variable.

Step 2: Request temporary credentials using the Client RequestTemporaryCredentials method. The callbackURL parameter is the URL of the callback handler in step 4. Save the returned credential secret so that it can be later found using credential token as a key. The secret can be stored in a database keyed by the token. Another option is to store the token and secret in session storage or a cookie.

Step 3: Redirect the user to URL returned from AuthorizationURL method. The AuthorizationURL method uses the temporary credentials from step 2 and other parameters as specified by the server.

Step 4: The server redirects back to the callback URL specified in step 2 with the temporary token and a verifier. Use the temporary token to find the temporary secret saved in step 2. Using the temporary token, temporary secret and verifier, request token credentials using the client RequestToken method. Save the returned credentials for later use in the application.

Signing Requests

The Client type has two low-level methods for signing requests, SignForm and SetAuthorizationHeader.

The SignForm method adds an OAuth signature to a form. The application makes an authenticated request by encoding the modified form to the query string or request body.

The SetAuthorizationHeader method adds an OAuth siganture to a request header. The SetAuthorizationHeader method is the only way to correctly sign a request if the application sets the URL Opaque field when making a request.

The Get, Put, Post and Delete methods sign and invoke a request using the supplied net/http Client. These methods are easy to use, but not as flexible as constructing a request using one of the low-level methods.

Imported by 375 package(s)

  1. bitbucket.org/phlyingpenguin/twitter
  2. camlistore.org/pkg/importer
  3. camlistore.org/pkg/importer/flickr
  4. camlistore.org/pkg/importer/twitter
  5. github.com/140proof/anaconda
  6. github.com/4ydx/fofou
  7. github.com/8pockets/hatena-go
  8. github.com/9uuso/anaconda
  9. github.com/AAAton/goContextIO
  10. github.com/Abramovic/anaconda
  11. github.com/Alfonsib/web-blog/go
  12. github.com/Archs/dropbox-go/dropbox
  13. github.com/BharathMG/anaconda
  14. github.com/ChimeraCoder/anaconda
  15. github.com/Chubik/twitterstream-1
  16. github.com/DrayChou/go-twitter
  17. github.com/Fe4nn0r/anaconda
  18. github.com/FiloSottile/camlistore/pkg/importer
  19. github.com/FiloSottile/camlistore/pkg/importer/flickr
  20. github.com/FiloSottile/camlistore/pkg/importer/twitter
  21. github.com/Francesco149/anaconda
  22. github.com/Francesco149/gweet
  23. github.com/Goryudyuma/anaconda
  24. github.com/Insightpool/anaconda
  25. github.com/Intermernet/anaconda
  26. github.com/Intermernet/xlqbo
  27. github.com/Invoiced/anaconda
  28. github.com/Januzellij/anaconda
  29. github.com/JosePedroDias/anaconda
  30. github.com/JustAdam/streamingtwitter
  31. github.com/K4orta/lunchclub-api/yelp
  32. github.com/KingBARD/GoTweet/Twitter
  33. github.com/MasterPpv/StreamQuestions
  34. github.com/MaxCDN/go-maxcdn
  35. github.com/MrTravisB/go-maxcdn
  36. github.com/My-Sign/anaconda
  37. github.com/ReformedDevs/anonbot/tweeter
  38. github.com/Reisender/photosync
  39. github.com/Rompei/bot-net-framework
  40. github.com/SocialHarvestVendors/anaconda
  41. github.com/Staylett/copy-go
  42. github.com/Syfaro/unfollowers
  43. github.com/Teamwork/anaconda
  44. github.com/TheOnly92/anaconda
  45. github.com/Wouterbeets/anaconda
  46. github.com/Xackery/anaconda
  47. github.com/Xackery/viper/tumblr
  48. github.com/ZachOrr/bullhorn
  49. github.com/ZhangBanger/dropbox-go/dropbox
  50. github.com/abadojack/anaconda
  51. github.com/abramovic/anaconda
  52. github.com/ahamidi/anaconda
  53. github.com/aidenliu/go-ynote
  54. github.com/ainsleyc/factual-go-driver
  55. github.com/alexcason/pitchcard-go
  56. github.com/alvarolm/go-gtk/example/twitterstream
  57. github.com/amaudy/apptranslator
  58. github.com/amaudy/apptranslator/tools/listbackup
  59. github.com/amit-lulla/twitterapi
  60. github.com/anastasop/dodger
  61. github.com/anastasop/oneshot
  62. github.com/andrewwatson/anaconda
  63. github.com/anmitsu/go-gtk/example/twitterstream
  64. github.com/aoisensi/booltter
  65. github.com/apseria/copy-go
  66. github.com/arduino/go-xero/xero
  67. github.com/areusch/httpcodec
  68. github.com/astrata/twitter
  69. github.com/astrophor/go-oauth/examples/appengine
  70. github.com/astrophor/go-oauth/examples/discogs
  71. github.com/astrophor/go-oauth/examples/dropbox
  72. github.com/astrophor/go-oauth/examples/quickbooks
  73. github.com/astrophor/go-oauth/examples/smugmug
  74. github.com/astrophor/go-oauth/examples/twitter
  75. github.com/astrophor/go-oauth/examples/yelp
  76. github.com/azr/anaconda
  77. github.com/bancek/go-copy/copy
  78. github.com/bclymer/aboutme/aboutme
  79. github.com/beardface/go-oauth/examples/dropbox
  80. github.com/beardface/go-oauth/examples/netflix
  81. github.com/beardface/go-oauth/examples/smugmug
  82. github.com/beardface/go-oauth/examples/twitter
  83. github.com/beme/anaconda
  84. github.com/benfb/notable/notable
  85. github.com/benoitletondor/anaconda
  86. github.com/bep/anaconda
  87. github.com/beyang/go-dropbox
  88. github.com/beyang/go-dropbox/example
  89. github.com/bgpat/twtr
  90. github.com/bingbaba/hhsecret
  91. github.com/bobrik/anaconda
  92. github.com/boynux/anaconda
  93. github.com/bww/twitterstream
  94. github.com/camlistore/camlistore/pkg/importer
  95. github.com/camlistore/camlistore/pkg/importer/flickr
  96. github.com/camlistore/camlistore/pkg/importer/twitter
  97. github.com/carbocation/anaconda
  98. github.com/carbocation/twitter
  99. github.com/cgag/anaconda
  100. github.com/chimeracoder/anaconda
  101. github.com/chobie/gtig/twitter
  102. github.com/choueric/gogobird
  103. github.com/chrissexton/alepale/plugins
  104. github.com/clsung/plurgo/plurkgo
  105. github.com/cnaize/anaconda
  106. github.com/codeactual/anaconda
  107. github.com/collinglass/blarg
  108. github.com/contextio/contextio-go/ciolite
  109. github.com/cookieo9/dropbox-go
  110. github.com/corrupt/anaconda
  111. github.com/creack/go-maxcdn
  112. github.com/crowdriff/twitter
  113. github.com/cryptix/anaconda
  114. github.com/d2r2/go-gtk/example/twitterstream
  115. github.com/dabfleming/anaconda
  116. github.com/darkhelmet/twitterstream
  117. github.com/davidk/anaconda
  118. github.com/diegogub/fofou/go
  119. github.com/dionyself/go-gtk/example/twitterstream
  120. github.com/djadala/go-gtk/example/twitterstream
  121. github.com/djannot/anaconda
  122. github.com/djannot/tweetstream/twitterstream
  123. github.com/djhworld/anaconda
  124. github.com/dmlyons/contextIOTest/goContextIO
  125. github.com/dmlyons/goContextIO
  126. github.com/dns-gh/anaconda
  127. github.com/dominichamon/anaconda
  128. github.com/drhodes/go-gtk/example/twitterstream
  129. github.com/dyv/anaconda
  130. github.com/dyv/twitterstream
  131. github.com/echa/go-oauth/examples/appengine
  132. github.com/echa/go-oauth/examples/dropbox
  133. github.com/echa/go-oauth/examples/netflix
  134. github.com/echa/go-oauth/examples/quickbooks
  135. github.com/echa/go-oauth/examples/smugmug
  136. github.com/echa/go-oauth/examples/twitter
  137. github.com/eewang/go-fantasy
  138. github.com/enj/anaconda
  139. github.com/erbridge/anaconda
  140. github.com/eric-fouillet/anaconda
  141. github.com/ericfouillet/anaconda
  142. github.com/exchgr/unff
  143. github.com/farss/go-gtk/example/twitterstream
  144. github.com/faxal/go-oauth/examples/appengine
  145. github.com/faxal/go-oauth/examples/dropbox
  146. github.com/faxal/go-oauth/examples/netflix
  147. github.com/faxal/go-oauth/examples/smugmug
  148. github.com/faxal/go-oauth/examples/twitter
  149. github.com/fiber/go-gtk/example/twitterstream
  150. github.com/floresj/anaconda
  151. github.com/foreversmart/go-oauth/examples/appengine
  152. github.com/foreversmart/go-oauth/examples/discogs
  153. github.com/foreversmart/go-oauth/examples/dropbox
  154. github.com/foreversmart/go-oauth/examples/netflix
  155. github.com/foreversmart/go-oauth/examples/quickbooks
  156. github.com/foreversmart/go-oauth/examples/smugmug
  157. github.com/foreversmart/go-oauth/examples/twitter
  158. github.com/freman/anaconda
  159. github.com/galaek/tuitinPFC/ejemplos/ejemploREST
  160. github.com/galeone/anaconda
  161. github.com/garyburd/go-oauth/examples/appengine
  162. github.com/garyburd/go-oauth/examples/discogs
  163. github.com/garyburd/go-oauth/examples/dropbox
  164. github.com/garyburd/go-oauth/examples/quickbooks
  165. github.com/garyburd/go-oauth/examples/smugmug
  166. github.com/garyburd/go-oauth/examples/twitter
  167. github.com/garyburd/go-oauth/examples/twitteroob
  168. github.com/garyburd/go-oauth/examples/yelp
  169. github.com/gi4nks/twty
  170. github.com/gilankpam/earthquapps-smsd/api
  171. github.com/gnanderson/anaconda
  172. github.com/go-social/social/providers/twitter
  173. github.com/grapswiz/board-gamers
  174. github.com/gulyasm/anaconda
  175. github.com/hamman/anaconda
  176. github.com/hawx/tw-stream
  177. github.com/hhh0pE/anaconda
  178. github.com/hut8/twitterstream
  179. github.com/i0n/anaconda
  180. github.com/iamthebot/anaconda
  181. github.com/ianatha/tweety-server-startup/reusable
  182. github.com/iand/twty
  183. github.com/ifross89/anaconda
  184. github.com/inatus/go-gtk/example/twitterstream
  185. github.com/intngbl/oauthv
  186. github.com/itsabot/plugin_mechanic
  187. github.com/itsabot/plugin_restaurants
  188. github.com/iwataka/anaconda
  189. github.com/jbuberel/anaconda
  190. github.com/jeffwilliams/go-gtk/example/twitterstream
  191. github.com/jinseokYeom/go-gtk/example/twitterstream
  192. github.com/joac/twitterapi
  193. github.com/jonthornton/martini-contrib-oauth1/oauth1
  194. github.com/josephyzhou/anaconda
  195. github.com/josharian/go-oauth/examples/appengine
  196. github.com/josharian/go-oauth/examples/dropbox
  197. github.com/josharian/go-oauth/examples/netflix
  198. github.com/josharian/go-oauth/examples/smugmug
  199. github.com/josharian/go-oauth/examples/twitter
  200. github.com/jpibarra1130/anaconda
  201. github.com/jsdir/blarg
  202. github.com/jsha/anaconda
  203. github.com/jun06t/oauth-twitter
  204. github.com/k4orta/lunchclub-api/yelp
  205. github.com/kan/go-retro-bot
  206. github.com/katnegermis/anaconda
  207. github.com/keima/anaconda
  208. github.com/kendrickm/anaconda
  209. github.com/khirayama/go-training/oreilly/socialpoll/twittervotes
  210. github.com/kirs/anaconda
  211. github.com/kjk/apptranslator
  212. github.com/kjk/fofou
  213. github.com/kjk/web-blog
  214. github.com/kkdai/plurgo/plurkgo
  215. github.com/koblas/anaconda
  216. github.com/kwmt/go-web-oreilly/chapter5/socialpoll/twittervotes
  217. github.com/lantius/fofou/go
  218. github.com/ling0322/twidoka
  219. github.com/liwp-stephen/apptranslator
  220. github.com/liyu-wang/go-socialpoll/twittervotes
  221. github.com/lygaret/experiments
  222. github.com/lygaret/experiments/tweetism
  223. github.com/machinebox/twitterfeed
  224. github.com/maddyonline/apptranslator
  225. github.com/maddyonline/apptranslator/tools/listbackup
  226. github.com/matryer/go-oauth/examples/appengine
  227. github.com/matryer/go-oauth/examples/dropbox
  228. github.com/matryer/go-oauth/examples/netflix
  229. github.com/matryer/go-oauth/examples/smugmug
  230. github.com/matryer/go-oauth/examples/twitter
  231. github.com/mattn/go-gtk/example/twitterstream
  232. github.com/mattn/gxuitter
  233. github.com/mattn/twitterstream
  234. github.com/mattn/twty
  235. github.com/may215/anaconda
  236. github.com/mccutchen/anaconda
  237. github.com/mdeheij/anaconda
  238. github.com/mhfs/anaconda
  239. github.com/micromdm/dep
  240. github.com/mikoto2000/twty/twitter
  241. github.com/mischief/twty
  242. github.com/mkaz/twstorage
  243. github.com/mmanjoura/camlistore/pkg/importer
  244. github.com/mnovozhylov/go-oauth/examples/appengine
  245. github.com/mnovozhylov/go-oauth/examples/discogs
  246. github.com/mnovozhylov/go-oauth/examples/dropbox
  247. github.com/mnovozhylov/go-oauth/examples/quickbooks
  248. github.com/mnovozhylov/go-oauth/examples/smugmug
  249. github.com/mnovozhylov/go-oauth/examples/twitter
  250. github.com/mnovozhylov/go-oauth/examples/yelp
  251. github.com/mohafe/copy-go
  252. github.com/morphar/SmugMugMugger
  253. github.com/mpl/camlistore/pkg/importer
  254. github.com/mpl/camlistore/pkg/importer/flickr
  255. github.com/mpl/camlistore/pkg/importer/twitter
  256. github.com/mrtravisb/go-maxcdn
  257. github.com/muesli/anaconda
  258. github.com/mukundmr/tweet_words
  259. github.com/my-sign/anaconda
  260. github.com/mycroft/go-snippets/twitter
  261. github.com/nd2s/twitterstream
  262. github.com/nickoneill/go-dropbox
  263. github.com/nickoneill/go-dropbox/example
  264. github.com/nickoneill/go-publisher
  265. github.com/nictuku/javaitarde/crawl
  266. github.com/njern/anaconda
  267. github.com/ntk1000/go-web-book-playground/c5/socialpoll/twittervotes
  268. github.com/ntk1000/go-web-book-playground/c5mod/socialpoll/twittervotes
  269. github.com/ntns/twty
  270. github.com/nubleer/oauthv
  271. github.com/nwolber/anaconda
  272. github.com/nyanshak/twitterbots/echobot
  273. github.com/nyanshak/twitterbots/stockbot
  274. github.com/paceline/autosite-go/autosite
  275. github.com/pagoenka/tweet_words
  276. github.com/penguinxr2/anaconda
  277. github.com/pharrisee/anaconda
  278. github.com/philippfranke/tweecli
  279. github.com/pocke/anaconda
  280. github.com/polds/anaconda
  281. github.com/pymander/anaconda
  282. github.com/q231950/xingapi
  283. github.com/qmmp123/go-gtk/example/twitterstream
  284. github.com/quelbs/web-blog/go
  285. github.com/ralfonso/anaconda
  286. github.com/rayleyva/apptranslator
  287. github.com/rayyildiz/anaconda
  288. github.com/remeh/anaconda
  289. github.com/rendon/anaconda
  290. github.com/renquinn/anaconda
  291. github.com/rfsbraz/anaconda
  292. github.com/robertabcd/dropbox-go
  293. github.com/robinjmurphy/go-readability-api/readability
  294. github.com/rolandshoemaker/camlistore/pkg/importer
  295. github.com/rolandshoemaker/camlistore/pkg/importer/flickr
  296. github.com/rolandshoemaker/camlistore/pkg/importer/twitter
  297. github.com/rplauche/anaconda
  298. github.com/ryanmr/prism-cli
  299. github.com/satoshun/anaconda
  300. github.com/satran/twty
  301. github.com/sebkl/twitterstream
  302. github.com/seven5/seven5
  303. github.com/sgmac/goblueprints/socialpoll
  304. github.com/shinderuman/anaconda
  305. github.com/shiwork/favpost/server
  306. github.com/silvasur/go-gtk/example/twitterstream
  307. github.com/slok/go-copy/copy
  308. github.com/sugyan/mentionbot
  309. github.com/suicidegang/chttp
  310. github.com/syama666/anaconda
  311. github.com/tSU-RooT/anaconda
  312. github.com/tSU-RooT/go-gtk/example/twitterstream
  313. github.com/taironas/gonawin/controllers/sessions
  314. github.com/tajtiattila/camlistore/pkg/importer
  315. github.com/tajtiattila/camlistore/pkg/importer/flickr
  316. github.com/tajtiattila/camlistore/pkg/importer/twitter
  317. github.com/taruti/go-gtk/example/twitterstream
  318. github.com/teamwork/anaconda
  319. github.com/telemetryapp/gotelemetry_agent/agent/oauth
  320. github.com/thatha/tweety-server-startup/reusable
  321. github.com/therahulprasad/goBroadcastTweets
  322. github.com/thisissoon/go-xero/authorizers/go-oauth
  323. github.com/thomasmodeneis/twittbid/twittbid
  324. github.com/thraxil/frontdesk
  325. github.com/thraxil/intweet
  326. github.com/tknhs/Surelock-Homes
  327. github.com/tkornblit/anaconda
  328. github.com/tncardoso/artreepie
  329. github.com/todostreaming/go-gtk/example/twitterstream
  330. github.com/tpltnt/anaconda
  331. github.com/trusch/twitterstream
  332. github.com/tschroed/flickr_to_photos/flickr
  333. github.com/tumdum/anaconda
  334. github.com/tux0010/twitterstream
  335. github.com/ukai/go-programming-blueprints/appendixB/socialpoll/twittervotes
  336. github.com/ukai/go-programming-blueprints/chapter5/socialpoll/twittervotes
  337. github.com/ukai/go-programming-blueprints/chapter6/socialpoll/twittervotes
  338. github.com/utahta/go-twitter
  339. github.com/utahta/go-twitter-oauth
  340. github.com/venkat/kuruvi
  341. github.com/veqryn/contextio-go/cioutil
  342. github.com/vim-jp/post_issues
  343. github.com/wh1t3w01f/go-gtk/example/twitterstream
  344. github.com/whinette/anaconda
  345. github.com/wizarddewhite/web-blog
  346. github.com/wskinner/anaconda
  347. github.com/wwkeyboard/twitter-links
  348. github.com/xackery/anaconda
  349. github.com/xiam/twitter
  350. github.com/xiam/twitter/cli/twitter
  351. github.com/xpeppers/twitter_listener/listener
  352. github.com/yagince/anaconda
  353. github.com/yanatan16/anaconda
  354. github.com/yangzhe1991/go-ynote
  355. github.com/yanunon/go-tap/tap
  356. github.com/yanunon/go-twip/go/server
  357. github.com/ymotongpoo/go-twitter/twitter
  358. github.com/yosida95/twitter-trailer
  359. github.com/youdao-api/go-ynote
  360. github.com/yourok/go-gtk/example/twitterstream
  361. github.com/zachaysan/fhp
  362. github.com/zhaytee/anaconda
  363. github.com/zhaytee/botville
  364. github.com/zhaytee/twitterstream
  365. github.com/zhenjl/twty
  366. gitlab.com/tamasd/ab/services/auth
  367. gopkg.in/MaxCDN/go-maxcdn.v1
  368. gopkg.in/MaxCDN/go-maxcdn.v2
  369. gopkg.in/MaxCDN/go-maxcdn.v3
  370. gopkg.in/cookieo9/dropbox-go.v0
  371. gopkg.in/cookieo9/v0/dropbox-go
  372. gopkg.in/garyburd/twitterstream.v0
  373. gopkg.in/maxcdn/go-maxcdn.v1
  374. gopkg.in/maxcdn/go-maxcdn.v2
  375. hawx.me/code/tw-stream

Imported only in test by 12 package(s)

  1. github.com/CanonicalLtd/candid/idp/usso/ussooauth
  2. github.com/astrophor/go-oauth/oauth
  3. github.com/beardface/go-oauth/oauth
  4. github.com/brettlangdon/go-oauth/oauth
  5. github.com/faxal/go-oauth/oauth
  6. github.com/foreversmart/go-oauth/oauth
  7. github.com/ifosch/goline/goline
  8. github.com/josharian/go-oauth/oauth
  9. github.com/matryer/go-oauth/oauth
  10. github.com/mnovozhylov/go-oauth/oauth
  11. github.com/mpbart/go-oauth/oauth
  12. github.com/sachinanand/go-oauth/oauth