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

Imported only in test by 14 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/goroom/go-oauth/oauth
  8. github.com/hori-ryota/go-oauth/oauth
  9. github.com/ifosch/goline/goline
  10. github.com/josharian/go-oauth/oauth
  11. github.com/matryer/go-oauth/oauth
  12. github.com/mnovozhylov/go-oauth/oauth
  13. github.com/mpbart/go-oauth/oauth
  14. github.com/sachinanand/go-oauth/oauth