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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Toru Kawamura
December 21, 2011
Programming
1
170
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
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
CSC307 Lecture 07
javiergs
PRO
0
550
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
今から始めるClaude Code超入門
448jp
8
8.6k
Data-Centric Kaggle
isax1015
2
770
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
CSC307 Lecture 03
javiergs
PRO
1
490
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
Featured
See All Featured
Abbi's Birthday
coloredviolet
1
4.7k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
Become a Pro
speakerdeck
PRO
31
5.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
First, design no harm
axbom
PRO
2
1.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Deep Space Network (abreviated)
tonyrice
0
47
Docker and Python
trallard
47
3.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.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/ ։ൃத