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
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
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
170
CSC307 Lecture 01
javiergs
PRO
0
670
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
520
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.4k
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1k
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
240
CSC307 Lecture 03
javiergs
PRO
1
470
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
130
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
650
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
39k
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
340
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
220
Featured
See All Featured
A Tale of Four Properties
chriscoyier
162
24k
Accessibility Awareness
sabderemane
0
34
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
600
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
210
The untapped power of vector embeddings
frankvandijk
1
1.5k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
How to make the Groovebox
asonas
2
1.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
4 Signs Your Business is Dying
shpigford
187
22k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
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/ ։ൃத