Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OAuth Echo の Rails Gem

OAuth Echo の Rails Gem

補足などはこちら
http://d.hatena.ne.jp/tkawa/20111222/p1

Toru Kawamura

December 21, 2011
Tweet

Other Decks in Programming

Transcript

  1. 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"
  2. 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" ʢ΄΅ʣ͜Ε͚ͩ
  3. class PostsController < ApplicationController http_basic_authenticate_with :name => "tkawa", :password =>

    "secret" def index render :json => { :message => "Limited Access" } end ... end ͔ΜͨΜBasicೝূ
  4. class PostsController < ApplicationController oauth_echo_authenticate_with :twitter def index render :json

    => { :message => "Limited Access" } end ... end ͔ΜͨΜOAuth Echoೝূ