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