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

Imported only in test by 11 package(s)

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