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
130
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
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
雑に思考を整理する技術と効能
konifar
64
30k
GitHub Copilotのススメ
marcy731
1
230
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
380
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
680
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
130
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
10
1.5k
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
910
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
900
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
470
Going beyond Apache Parquet's default settings
xhochy
0
140
Elm 0.19.0 Changes
bkuhlmann
0
510
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.8k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Designing Experiences People Love
moore
136
23k
Building an army of robots
kneath
300
41k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
[RailsConf 2023] Rails as a piece of cake
palkan
28
4k
Making Projects Easy
brettharned
109
5.5k
Teambox: Starting and Learning
jrom
128
8.4k
Thoughts on Productivity
jonyablonski
60
3.9k
How STYLIGHT went responsive
nonsquared
92
4.8k
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/ ։ൃத