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
CSC307 Lecture 08
javiergs
PRO
0
670
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
540
Fluid Templating in TYPO3 14
s2b
0
130
Package Management Learnings from Homebrew
mikemcquaid
0
220
AI & Enginnering
codelynx
0
110
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
440
Patterns of Patterns
denyspoltorak
0
1.4k
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Featured
See All Featured
BBQ
matthewcrist
89
10k
Between Models and Reality
mayunak
1
190
ラッコキーワード サービス紹介資料
rakko
1
2.3M
The Curious Case for Waylosing
cassininazir
0
230
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
A Tale of Four Properties
chriscoyier
162
24k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
710
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
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/ ։ൃத