-
-
Save riocampos/613373cd4cade1a415ea to your computer and use it in GitHub Desktop.
use OmniAuth::Builder した状況の Sinatra において /auth/twitter/callback ルートでの各インスタンス変数の値
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SERVER_SOFTWARE"=>"thin 1.6.3 codename Protein Powder", | |
"SERVER_NAME"=>"localhost", | |
"rack.input"=>#<StringIO:0x007fd0bcb6c2b0>, | |
"rack.version"=>[1, 0], | |
"rack.errors"=>#<IO:<STDERR>>, | |
"rack.multithread"=>true, | |
"rack.multiprocess"=>false, | |
"rack.run_once"=>false, | |
"REQUEST_METHOD"=>"GET", | |
"REQUEST_PATH"=>"/auth/twitter/callback", | |
"PATH_INFO"=>"/auth/twitter/callback", | |
"QUERY_STRING"=>"oauth_token=OAUTH_TOKEN&oauth_verifier=OAUTH_VERIFIER", | |
"REQUEST_URI"=>"/auth/twitter/callback?oauth_token=OAUTH_TOKEN&oauth_verifier=OAUTH_VERIFIER", | |
"HTTP_VERSION"=>"HTTP/1.1", | |
"HTTP_HOST"=>"localhost:4567", | |
"HTTP_CONNECTION"=>"keep-alive", | |
"HTTP_ACCEPT"=>"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", | |
"HTTP_USER_AGENT"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36", | |
"HTTP_ACCEPT_ENCODING"=>"gzip, deflate, sdch", | |
"HTTP_ACCEPT_LANGUAGE"=>"ja,en-US;q=0.8,en;q=0.6", | |
"HTTP_COOKIE"=>"rack.session=RACK.SESSION", | |
"GATEWAY_INTERFACE"=>"CGI/1.2", | |
"SERVER_PORT"=>"4567", | |
"SERVER_PROTOCOL"=>"HTTP/1.1", | |
"rack.url_scheme"=>"http", | |
"SCRIPT_NAME"=>"", | |
"REMOTE_ADDR"=>"127.0.0.1", | |
"async.callback"=>#<Method: Thin::Connection#post_process>, | |
"async.close"=>#<EventMachine::DefaultDeferrable:0x007fd0bcb6a5c8>, | |
"sinatra.commonlogger"=>true, | |
"rack.logger"=> | |
#<Logger:0x007fd0bcb6a370 | |
@default_formatter=#<Logger::Formatter:0x007fd0bcb6a348 @datetime_format=nil>, | |
@formatter=nil, | |
@level=1, | |
@logdev= | |
#<Logger::LogDevice:0x007fd0bcb6a280 | |
@dev=#<IO:<STDERR>>, | |
@filename=nil, | |
@mutex= | |
#<Logger::LogDevice::LogDeviceMutex:0x007fd0bcb6a258 | |
@mon_count=0, | |
@mon_mutex=#<Mutex:0x007fd0bcb6a1b8>, | |
@mon_owner=nil | |
>, | |
@shift_age=nil, | |
@shift_size=nil | |
>, | |
@progname=nil | |
>, | |
"rack.session"=> | |
{ | |
"session_id"=>"SESSION_ID", "csrf"=>"CSRF", | |
"tracking"=> | |
{ | |
"HTTP_USER_AGENT"=>"70a6656b8f311ea45be0a1759db78360cb11ffa2", | |
"HTTP_ACCEPT_LANGUAGE"=>"2668ccc0b26c1ada1e450bf13e21e51501a40422" | |
}, | |
"oauth"=>{"twitter"=>{"callback_confirmed"=>true}} | |
}, | |
"rack.session.options"=> | |
{ | |
:path=>"/", | |
:domain=>nil, | |
:expire_after=>nil, | |
:secure=>false, | |
:httponly=>true, | |
:defer=>false, | |
:renew=>false, | |
:sidbits=>128, | |
:secure_random=>SecureRandom, | |
:secret=>"2015-02-02T21:56:36+09:00", | |
:coder=>#<Rack::Session::Cookie::Base64::Marshal:0x007fd0bcb34518> | |
}, | |
"rack.request.cookie_hash"=>{"rack.session"=>"RACK.SESSION"}, | |
"rack.request.cookie_string"=>"rack.session=RACK.SESSION", | |
"rack.session.unpacked_cookie_data"=> | |
{ | |
"session_id"=>"SESSION_ID", | |
"csrf"=>"CSRF", | |
"tracking"=> | |
{ | |
"HTTP_USER_AGENT"=>"70a6656b8f311ea45be0a1759db78360cb11ffa2", | |
"HTTP_ACCEPT_LANGUAGE"=>"2668ccc0b26c1ada1e450bf13e21e51501a40422" | |
}, | |
"omniauth.params"=>{}, | |
"omniauth.origin"=>"http://localhost:4567/", | |
"oauth"=>{"twitter"=>{"callback_confirmed"=>true}} | |
}, | |
"omniauth.strategy"=>#<OmniAuth::Strategies::Twitter>, | |
"omniauth.origin"=>"http://localhost:4567/", | |
"omniauth.params"=>{}, | |
"rack.request.query_string"=>"oauth_token=OAUTH_TOKEN&oauth_verifier=OAUTH_VERIFIER", | |
"rack.request.query_hash"=> | |
{ | |
"oauth_token"=>"OAUTH_TOKEN", | |
"oauth_verifier"=>"OAUTH_VERIFIER" | |
}, | |
"omniauth.auth"=> | |
{ | |
"provider"=>"twitter", | |
"uid"=>"56997313", | |
"info"=> | |
{ | |
"nickname"=>"riocampos", | |
"name"=>"riocampos(りおかんぽす)", | |
"location"=>"Osaka, Japan", | |
"image"=> | |
"http://pbs.twimg.com/profile_images/555013502025216000/InbG3y6I_normal.jpeg", | |
"description"=>"plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂", | |
"urls"=> | |
{ | |
"Website"=>"http://t.co/KlG79Y3tGU", | |
"Twitter"=>"https://twitter.com/riocampos" | |
} | |
}, | |
"credentials"=> | |
{ | |
"token"=>"OAUTH_TOKEN", | |
"secret"=>"OAUTH_TOKEN_SECRET" | |
}, | |
"extra"=> | |
{ | |
"access_token"=> | |
#<OAuth::AccessToken:0x007fbfa3e1cf48 | |
@consumer= | |
#<OAuth::Consumer:0x007fbfa3dfa808 | |
@http=#<Net::HTTP api.twitter.com:443 open=false>, | |
@http_method=:post, | |
@key="consumer_key", | |
@options= | |
{ | |
:signature_method=>"HMAC-SHA1", | |
:request_token_path=>"/oauth/request_token", | |
:authorize_path=>"/oauth/authenticate", | |
:access_token_path=>"/oauth/access_token", | |
:proxy=>nil, | |
:scheme=>:header, | |
:http_method=>:post, | |
:oauth_version=>"1.0", | |
:site=>"https://api.twitter.com" | |
}, | |
@secret="consumer_secret", | |
@uri=#<URI::HTTPS:0x007fbfa3e1c188 URL:https://api.twitter.com> | |
>, | |
@params= | |
{ | |
:oauth_token=>"OAUTH_TOKEN, | |
"oauth_token"=>"OAUTH_TOKEN", | |
:oauth_token_secret=>"OAUTH_TOKEN_SECRET", | |
"oauth_token_secret"=>"OAUTH_TOKEN_SECRET", | |
:user_id=>"56997313", | |
"user_id"=>"56997313", | |
:screen_name=>"riocampos", | |
"screen_name"=>"riocampos" | |
}, | |
@response=#<Net::HTTPOK 200 OK readbody=true>, | |
@secret="OAUTH_TOKEN_SECRET", | |
@token="OAUTH_TOKEN" | |
>, | |
"raw_info"=> | |
{ | |
"id"=>56997313, | |
"id_str"=>"56997313", | |
"name"=>"riocampos(りおかんぽす)", | |
"screen_name"=>"riocampos", | |
"location"=>"Osaka, Japan", | |
"profile_location"=>nil, | |
"description"=>"plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂", | |
"url"=>"http://t.co/KlG79Y3tGU", | |
"entities"=> | |
{ | |
"url"=> | |
{ | |
"urls"=> | |
[{ | |
"url"=>"http://t.co/KlG79Y3tGU", | |
"expanded_url"=>"http://about.me/riocampos", | |
"display_url"=>"about.me/riocampos", | |
"indices"=>[0, 22] | |
}] | |
}, | |
"description"=>{"urls"=>[]} | |
}, | |
"protected"=>false, | |
"followers_count"=>2218, | |
"friends_count"=>2439, | |
"listed_count"=>196, | |
"created_at"=>"Wed Jul 15 12:02:35 +0000 2009", | |
"favourites_count"=>3092, | |
"utc_offset"=>32400, | |
"time_zone"=>"Tokyo", | |
"geo_enabled"=>true, | |
"verified"=>false, | |
"statuses_count"=>222965, | |
"lang"=>"en", | |
"contributors_enabled"=>false, | |
"is_translator"=>false, | |
"is_translation_enabled"=>false, | |
"profile_background_color"=>"48E0B7", | |
"profile_background_image_url"=>"http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", | |
"profile_background_image_url_https"=>"https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", | |
"profile_background_tile"=>true, | |
"profile_image_url"=>"http://pbs.twimg.com/profile_images/555013502025216000/InbG3y6I_normal.jpeg", | |
"profile_image_url_https"=>"https://pbs.twimg.com/profile_images/555013502025216000/InbG3y6I_normal.jpeg", | |
"profile_banner_url"=>"https://pbs.twimg.com/profile_banners/56997313/1420302457", | |
"profile_link_color"=>"009999", | |
"profile_sidebar_border_color"=>"FFFFFF", | |
"profile_sidebar_fill_color"=>"EFEFEF", | |
"profile_text_color"=>"333333", | |
"profile_use_background_image"=>true, | |
"default_profile"=>false, | |
"default_profile_image"=>false, | |
"following"=>false, | |
"follow_request_sent"=>false, | |
"notifications"=>false | |
} | |
} | |
}, | |
"sinatra.route"=>"GET /auth/twitter/callback" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"SERVER_SOFTWARE", | |
"SERVER_NAME", | |
"rack.input", | |
"rack.version", | |
"rack.errors", | |
"rack.multithread", | |
"rack.multiprocess", | |
"rack.run_once", | |
"REQUEST_METHOD", | |
"REQUEST_PATH", | |
"PATH_INFO", | |
"QUERY_STRING", | |
"REQUEST_URI", | |
"HTTP_VERSION", | |
"HTTP_HOST", | |
"HTTP_CONNECTION", | |
"HTTP_ACCEPT", | |
"HTTP_USER_AGENT", | |
"HTTP_ACCEPT_ENCODING", | |
"HTTP_ACCEPT_LANGUAGE", | |
"HTTP_COOKIE", | |
"GATEWAY_INTERFACE", | |
"SERVER_PORT", | |
"SERVER_PROTOCOL", | |
"rack.url_scheme", | |
"SCRIPT_NAME", | |
"REMOTE_ADDR", | |
"async.callback", | |
"async.close", | |
"sinatra.commonlogger", | |
"rack.logger", | |
"rack.session", | |
"rack.session.options", | |
"rack.request.cookie_hash", | |
"rack.request.cookie_string", | |
"rack.session.unpacked_cookie_data", | |
"omniauth.strategy", | |
"omniauth.origin", | |
"omniauth.params", | |
"rack.request.query_string", | |
"rack.request.query_hash", | |
"omniauth.auth", | |
"sinatra.route" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"oauth_token"=>"OAUTH_TOKEN", | |
"oauth_verifier"=>"OAUTH_VERIFIER" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<Sinatra::Request:0x007f843abc9ad8 | |
@env={ 上記のenvの中身 }, | |
@params={ 上記のparamsの中身 } | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<Sinatra::Response:0x007fd0bd582cb8 | |
@block=nil, | |
@body=[], | |
@chunked=false, | |
@header={"Content-Type"=>nil}, | |
@length=0, | |
@status=200, | |
@writer=#<Proc:0x007fd0bd582b28@/<gem_path>/gems/rack-1.6.0/lib/rack/response.rb:30 (lambda)> | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment