Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OAuth Echo の Rails Gem
Search
Toru Kawamura
December 21, 2011
Programming
1
140
OAuth Echo の Rails Gem
補足などはこちら
http://d.hatena.ne.jp/tkawa/20111222/p1
Toru Kawamura
December 21, 2011
Tweet
Share
Other Decks in Programming
See All in Programming
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
180
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
160
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
200
선언형 UI에서의 상태관리
l2hyunwoo
0
200
return文におけるstd::moveについて
onihusube
1
1.3k
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
Go の GC の不得意な部分を克服したい
taiyow
3
840
Haze - Real time background blurring
chrisbanes
1
520
Jakarta EE meets AI
ivargrimstad
0
280
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
150
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
300
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
910
How to Ace a Technical Interview
jacobian
276
23k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Building Applications with DynamoDB
mza
91
6.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
A designer walks into a library…
pauljervisheath
205
24k
Code Review Best Practice
trishagee
65
17k
How STYLIGHT went responsive
nonsquared
96
5.2k
Optimizing for Happiness
mojombo
376
70k
The Cost Of JavaScript in 2023
addyosmani
46
7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.4k
Transcript
OAuth Echo ͷ Rails Gem 2011.12.21 ୈ2.1ճTwitter APIษڧձ #twtr_hack
@tkawa
None
REST
REST ࠓճؔ͋Γ·ͤΜ
OAuth Echo
None
TwitPic • ը૾ΞοϓϩʔυαʔϏε • ΞΧϯτొෆཁ • TwitterͷIDɾύεϫʔυೖྗෆཁ • Ͳ͏ͬͯೝূͯ͠Δͷʁ
OAuth Echo • ೝূΛService ProviderʢTwitterͳͲʣʹ ҕৡ͢Δ͘͠Έ • ΫϥΠΞϯτ͕OAuthొͯ͋͠Εɺ ࣄલͷొτʔΫϯऔಘ͕ෆཁ
None
GET https://api.twitter.com/1/account/ verify_credentials.json Authorization: OAuth oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0A QR3Fmi7Q6Y", oauth_signature="U1obTfE7Rs9J1kafTGwufLJdspo%3D", oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1272325550", oauth_token="819797- Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw", oauth_version="1.0"
POST http://api.twitpic.com/2/upload.json X-Auth-Service-Provider: https://api.twitter.com/1/ account/verify_credentials.json X-Verify-Credentials-Authorization: OAuth oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0A QR3Fmi7Q6Y",
oauth_signature="U1obTfE7Rs9J1kafTGwufLJdspo%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1272325550", oauth_token="819797- Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw", oauth_version="1.0"
POST http://api.twitpic.com/2/upload.json X-Auth-Service-Provider: https://api.twitter.com/1/ account/verify_credentials.json X-Verify-Credentials-Authorization: OAuth oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0A QR3Fmi7Q6Y",
oauth_signature="U1obTfE7Rs9J1kafTGwufLJdspo%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1272325550", oauth_token="819797- Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw", oauth_version="1.0" ʢ΄΅ʣ͜Ε͚ͩ
GET https://api.twitter.com/1/account/ verify_credentials.json Authorization: OAuth oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0A QR3Fmi7Q6Y", oauth_signature="U1obTfE7Rs9J1kafTGwufLJdspo%3D", oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1272325550", oauth_token="819797- Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw", oauth_version="1.0"
OAuth Echo • Delegator(TwitPic)ϦΫΤετ͝ͱʹ Service Provider(Twitter)ʹೝূΛٻΊΔ • 1ϦΫΤετͰ݁͢Δ୯७ͳAPIͷ࣮ ʹ͍͍ͯΔ •
ೝূ͚ͩͳͷͰɺService Provider(Twitter) ଆʹॻ͖ࠐΜͩΓ͢Δ͜ͱͰ͖ͳ͍
• ඇެ༷ࣜ - ΄΅TwitterͰ͔͠ΘΕ͍ͯͳ͍ • OAuth 1.0༷ʹج͍͓ͮͯΓɺOAuth 2.0 ʹͳΔͱ͑ͳ͍ -
Google, Facebook, GitHubͳͲ͕OAuth 2.0 ʁ
None
class PostsController < ApplicationController http_basic_authenticate_with :name => "tkawa", :password =>
"secret" def index render :json => { :message => "Limited Access" } end ... end ͔ΜͨΜBasicೝূ
class PostsController < ApplicationController oauth_echo_authenticate_with :twitter def index render :json
=> { :message => "Limited Access" } end ... end ͔ΜͨΜOAuth Echoೝূ
https://github.com/tkawa/ oauth_echo_authentication
͖͔͚ͬ http://www.atmarkit.co.jp/news/201004/21/twitterapi.html
͖͔͚ͬ • TwitterͷΞϊςʔγϣϯͷ͕͍ͭͷ· ʹ͔ফ໓ • ࣗͰ͍͍͚ͨͩͰࣗͰ࡞Δ ͔
Webೝߦಈྍ๏ http://u2plus.jp/ ։ൃத