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