Skip to content

Instantly share code, notes, and snippets.

@fzero
Last active December 17, 2015 05:08
Show Gist options
  • Save fzero/5555199 to your computer and use it in GitHub Desktop.
Save fzero/5555199 to your computer and use it in GitHub Desktop.
Example OAuth callbacks as received by the omniauth gem for Twitter, Tumblr and Instagram.
--- !map:OmniAuth::AuthHash
provider: instagram
uid: "123456789"
info: !map:OmniAuth::AuthHash::InfoHash
nickname: instagram_handle
name: Full Instagram User Name
image: http://images.ak.instagram.com/profiles/profile_123456789_75sq_123456789.jpg
bio: Bio text goes here
website: http://example.com/
credentials: !map:OmniAuth::AuthHash
token: 123456789.123abcde.deadbeefdeadbeefdeadbeefdeadbeef
expires: false
extra: !map:OmniAuth::AuthHash {}
--- !map:OmniAuth::AuthHash
provider: tumblr
uid: user_name
info: !map:OmniAuth::AuthHash::InfoHash
nickname: user_name
name: user_name
blogs:
- !map:OmniAuth::AuthHash
name: first_blog
url: http://first_blog.tumblr.com/
title: First Blog
- !map:OmniAuth::AuthHash
name: second_blog
url: http://second_blog.tumblr.com/
title: Second Blog
avatar: http://25.media.tumblr.com/avatar_deadbeefdead_64.png
credentials: !map:OmniAuth::AuthHash
token: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
secret: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
extra: !map:OmniAuth::AuthHash
access_token: !ruby/object:OAuth::AccessToken
consumer: !ruby/object:OAuth::Consumer
http: !ruby/object:Net::HTTP
address: www.tumblr.com
ca_file: /etc/ssl/certs/ca-certificates.crt
ca_path:
cert:
cert_store:
ciphers:
close_on_empty_response: false
compression:
curr_http_version: "1.1"
debug_output:
enable_post_connection_check: true
key:
newimpl: true
no_keepalive_server: false
open_timeout: 30
port: 80
read_timeout: 30
socket:
ssl_context:
ssl_timeout:
ssl_version:
sspi_enabled: false
started: false
use_ssl: false
verify_callback:
verify_depth: 5
verify_mode: 1
http_method: :post
key: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
options:
:signature_method: HMAC-SHA1
:request_token_path: /oauth/request_token
:authorize_path: /oauth/authorize
:access_token_path: /oauth/access_token
:proxy:
:scheme: :header
:http_method: :post
:oauth_version: "1.0"
:site: http://www.tumblr.com
secret: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
uri: !ruby/object:URI::HTTP
fragment:
host: www.tumblr.com
opaque:
parser:
password:
path: ""
port: 80
query:
registry:
scheme: http
user:
params:
:oauth_token: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
oauth_token: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
:oauth_token_secret: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
oauth_token_secret: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
response: !ruby/object:Net::HTTPMovedPermanently
body: "{\"meta\":{\"status\":301,\"msg\":\"Found\"},\"response\":{\"avatar_url\":\"http:\\/\\/25.media.tumblr.com\\/avatar_deadbeefdead_64.png\"}}"
body_exist: true
code: "301"
header:
content-type:
- application/json
p3p:
- CP="ALL ADM DEV PSAi COM OUR OTRo STP IND ONL"
location:
- http://25.media.tumblr.com/avatar_deadbeefdead_64.png
content-length:
- "122"
date:
- Fri, 10 May 2013 14:46:23 GMT
connection:
- close
http_version: "1.1"
message: Found
read: true
socket:
secret: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
token: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde
raw_info: !map:OmniAuth::AuthHash
name: user_name
likes: 9
following: 1
default_post_format: html
blogs:
- !map:OmniAuth::AuthHash
name: first_blog
url: http://first_blog.tumblr.com/
followers: 12
primary: true
title: First Blog
description: "Description for First Blog"
admin: true
updated: 1365515388
posts: 1
messages: 1
queue: 0
drafts: 0
share_likes: true
ask: false
tweet: N
facebook: N
facebook_opengraph_enabled: N
type: public
- !map:OmniAuth::AuthHash
name: second_blog
url: http://second_blog.tumblr.com/
followers: 49928
primary: false
title: Second Blog
description: "Description for Second Blog"
admin: true
updated: 1368191678
posts: 9237
messages: 7
queue: 0
drafts: 9
share_likes: false
ask: false
tweet: N
facebook: N
facebook_opengraph_enabled: N
type: public
avatar: http://25.media.tumblr.com/avatar_deadbeefdead_64.png
--- !map:OmniAuth::AuthHash
provider: twitter
uid: "123456789"
info: !map:OmniAuth::AuthHash::InfoHash
nickname: twitter_handle
name: Full Name
location: City, State, Country
image: http://a0.twimg.com/profile_images/1234567890/icon-01_normal.png
description: The description, or bio, goes here.
urls: !map:OmniAuth::AuthHash
Website: http://example.com/
Twitter: http://twitter.com/example
credentials: !map:OmniAuth::AuthHash
token: 123456789-abcde12345ABCDE67890ZXCVBasdfg
secret: abcde12345ABCDE67890ZXCVBasdfg1234567890ab
extra: !map:OmniAuth::AuthHash
access_token: !ruby/object:OAuth::AccessToken
consumer: !ruby/object:OAuth::Consumer
http: !ruby/object:Net::HTTP
address: api.twitter.com
ca_file: /etc/ssl/certs/ca-certificates.crt
ca_path:
cert:
cert_store:
ciphers:
close_on_empty_response: false
compression:
curr_http_version: "1.1"
debug_output:
enable_post_connection_check: true
key:
newimpl: true
no_keepalive_server: false
open_timeout: 30
port: 443
read_timeout: 30
socket:
ssl_context: !ruby/object:OpenSSL::SSL::SSLContext
ca_file: /etc/ssl/certs/ca-certificates.crt
ca_path:
cert:
cert_store:
client_ca:
client_cert_cb:
extra_chain_cert:
key:
options: 4095
servername_cb:
session_get_cb:
session_id_context:
session_new_cb:
session_remove_cb:
timeout:
tmp_dh_callback:
verify_callback:
verify_depth: 5
verify_mode: 1
ssl_timeout:
ssl_version:
sspi_enabled: false
started: false
use_ssl: true
verify_callback:
verify_depth: 5
verify_mode: 1
http_method: :post
key: abcde12345ABCDE12345
options:
:signature_method: HMAC-SHA1
:request_token_path: /oauth/request_token
:authorize_path: /oauth/authenticate
:access_token_path: /oauth/access_token
:proxy:
:scheme: :header
:http_method: :post
:oauth_version: "1.0"
:site: https://api.twitter.com
secret: abcde12345ABCDE67890ZXCVBasdfg1234567890ab
uri: !ruby/object:URI::HTTPS
fragment:
host: api.twitter.com
opaque:
parser:
password:
path: ""
port: 443
query:
registry:
scheme: https
user:
params:
:oauth_token: 123456789-abcde12345ABCDE67890ZXCVBasdfgASDFGuiopq
oauth_token: 123456789-abcde12345ABCDE67890ZXCVBasdfgASDFGuiopq
:oauth_token_secret: abcde12345ABCDE67890ZXCVBasdfg1234567890ab
oauth_token_secret: abcde12345ABCDE67890ZXCVBasdfg1234567890ab
:user_id: "123456789"
user_id: "123456789"
:screen_name: twitter_handle
screen_name: twitter_handle
response: !ruby/object:Net::HTTPOK
body: "{\"id_str\":\"123456789\",\"url\":\"http:\\/\\/example.com\\/\",\"profile_sidebar_border_color\":\"C0DEED\",\"notifications\":false,\"name\":\"Full Name\",\"location\":\"City, State, Country\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\/\\/example.com\\/\",\"display_url\":null,\"expanded_url\":null,\"indices\":[0,35]}]},\"description\":{\"urls\":[]}},\"default_profile_image\":false,\"profile_background_tile\":false,\"screen_name\":\"twitter_handle\",\"id\":123456789,\"profile_sidebar_fill_color\":\"DDEEF6\",\"favourites_count\":98,\"status\":{\"in_reply_to_user_id_str\":\"123467890\",\"in_reply_to_status_id\":null,\"in_reply_to_screen_name\":\"another_user\",\"created_at\":\"Thu May 09 20:43:34 +0000 2013\",\"id_str\":\"32948769382469832\",\"entities\":{\"urls\":[{\"url\":\"http:\\/\\/t.co\\/abcdefghj\",\"display_url\":\"ow.ly\\/abcde\",\"expanded_url\":\"http:\\/\\/ow.ly\\/abcde\",\"indices\":[85,107]}],\"hashtags\":[],\"user_mentions\":[{\"screen_name\":\"another_user\",\"id_str\":\"1234567890\",\"id\":1234567890,\"indices\":[0,8],\"name\":\"another_user\"}]},\"favorited\":false,\"source\":\"\\u003Ca href=\\\"http:\\/\\/www.hootsuite.com\\\" rel=\\\"nofollow\\\"\\u003EHootSuite\\u003C\\/a\\u003E\",\"contributors\":null,\"place\":null,\"geo\":null,\"id\":3698327569843726543,\"possibly_sensitive\":false,\"in_reply_to_user_id\":1234567890,\"truncated\":false,\"coordinates\":null,\"retweet_count\":0,\"text\":\"@another_user Here's a reply, dude.\",\"in_reply_to_status_id_str\":null,\"retweeted\":false,\"possibly_sensitive_editable\":true},\"profile_image_url_https\":\"https:\\/\\/twimg0-a.akamaihd.net\\/profile_images\\/757865678\\/icon-01_normal.png\",\"statuses_count\":5663,\"profile_image_url\":\"http:\\/\\/a0.twimg.com\\/profile_images\\/657858765\\/icon-01_normal.png\",\"contributors_enabled\":false,\"time_zone\":\"Eastern Time (US & Canada)\",\"lang\":\"en\",\"profile_background_color\":\"F23F37\",\"utc_offset\":-18000,\"default_profile\":false,\"profile_background_image_url\":\"http:\\/\\/a0.twimg.com\\/images\\/themes\\/theme1\\/bg.png\",\"profile_link_color\":\"000000\",\"protected\":false,\"friends_count\":2065,\"created_at\":\"Wed May 09 18:20:16 +0000 2012\",\"description\":\"The description, or bio, goes here.\",\"geo_enabled\":false,\"verified\":false,\"following\":false,\"is_translator\":false,\"profile_use_background_image\":false,\"listed_count\":35,\"followers_count\":1979,\"profile_text_color\":\"333333\",\"profile_background_image_url_https\":\"https:\\/\\/twimg0-a.akamaihd.net\\/images\\/themes\\/theme1\\/bg.png\",\"follow_request_sent\":false}"
body_exist: true
code: "200"
header:
cache-control:
- no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-length:
- "2544"
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 May 2013 14:53:33 GMT
etag:
- "\"deadbeefdeadbeefdeadbeefdeadbeef\""
expires:
- Tue, 31 Mar 1981 05:00:00 GMT
last-modified:
- Fri, 10 May 2013 14:53:33 GMT
pragma:
- no-cache
server:
- tfe
set-cookie:
- dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
- lang=en; path=/
- lang=en; path=/
- lang=en; path=/
- twid=u%3245673gd64%7Csdkjhfd87h33rkhjhdsfhiuh783%3D; domain=.twitter.com; path=/; secure
- _twitter_sess=dsjkfhdlsufhoi43hfiulkjfhlfiuwheoiu4hlerkjfhlekfsdjhliuwh8hiluk4hflhkhu4iofilq34uhukhfwjklhflkufhwkuefhq38h3i8hflihflwhql8fhl48hfkhf8h4wlhfl84lw8h4flwl48wfhl4whfuflkw--fhh34ofi34huf9834qhf9834hf4q398ihun4i380; domain=.twitter.com; path=/; HttpOnly
- guest_id=v1%3A123456789123456789; Domain=.twitter.com; Path=/; Expires=Sun, 10-May-2015 14:53:33 UTC
status:
- 200 OK
strict-transport-security:
- max-age=631138519
vary:
- Accept-Encoding
x-access-level:
- read
x-frame-options:
- SAMEORIGIN
x-mid:
- deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
x-rate-limit-limit:
- "15"
x-rate-limit-remaining:
- "14"
x-rate-limit-reset:
- "1368198513"
x-runtime:
- "0.03268"
x-transaction:
- e0333190a961abff
x-transaction-mask:
- a6183ffa5f8ca943ff1b53b5644ef114225c11cd
connection:
- close
http_version: "1.1"
message: OK
read: true
socket:
secret: abcde12345ABCDE67890ZXCVBasdfg1234567890ab
token: 123456789-abcde12345ABCDE67890ZXCVBasdfgASDFGuiopq
raw_info: !map:OmniAuth::AuthHash
id_str: "123456789"
url: http://example.com/
profile_sidebar_border_color: C0DEED
notifications: false
name: Full Name
location: City, State, Country
entities: !map:OmniAuth::AuthHash
url: !map:OmniAuth::AuthHash
urls:
- !map:OmniAuth::AuthHash
url: http://example.com.com/
display_url:
expanded_url:
indices:
- 0
- 35
description: !map:OmniAuth::AuthHash
urls: []
default_profile_image: false
profile_background_tile: false
screen_name: twitter_handle
id: 123456789
profile_sidebar_fill_color: DDEEF6
favourites_count: 98
status: !map:OmniAuth::AuthHash
in_reply_to_user_id_str: "123456789"
in_reply_to_status_id:
in_reply_to_screen_name: other_user
created_at: Thu May 09 20:43:34 +0000 2013
id_str: "324987340529780534298"
entities: !map:OmniAuth::AuthHash
urls:
- !map:OmniAuth::AuthHash
url: http://t.co/compressed
display_url: ow.ly/compressed
expanded_url: http://ow.ly/expanded
indices:
- 85
- 107
hashtags: []
user_mentions:
- !map:OmniAuth::AuthHash
screen_name: other_user
id_str: "1234567890"
id: 1234567890
indices:
- 0
- 8
name: Other User
favorited: false
source: HootSuite
contributors:
place:
geo:
id: 23865320847659873425
possibly_sensitive: false
in_reply_to_user_id: 1234567890
truncated: false
coordinates:
retweet_count: 0
text: "@other_user Here's a reply, dude."
in_reply_to_status_id_str:
retweeted: false
possibly_sensitive_editable: true
profile_image_url_https: https://twimg0-a.akamaihd.net/profile_images/123456789/icon-01_normal.png
statuses_count: 5663
profile_image_url: http://a0.twimg.com/profile_images/123456789/icon-01_normal.png
contributors_enabled: false
time_zone: Eastern Time (US & Canada)
lang: en
profile_background_color: F23F37
utc_offset: -18000
default_profile: false
profile_background_image_url: http://a0.twimg.com/images/themes/theme1/bg.png
profile_link_color: "000000"
protected: false
friends_count: 2065
created_at: Wed May 09 18:20:16 +0000 2012
description: The description, or bio, goes here.
geo_enabled: false
verified: false
following: false
is_translator: false
profile_use_background_image: false
listed_count: 35
followers_count: 1979
profile_text_color: "333333"
profile_background_image_url_https: https://twimg0-a.akamaihd.net/images/themes/theme1/bg.png
follow_request_sent: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment