| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 23 Dec 2025 19:31:50 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100429220319
location: https://web.archive.org/web/20100429220319/https://github.com/intridea/oauth2/tree/v0.0.5
server-timing: captures_list;dur=0.909403, exclusion.robots;dur=0.094441, exclusion.robots.policy;dur=0.081665, esindex;dur=0.012242, cdx.remote;dur=21.202401, LoadShardBlock;dur=222.151271, PetaboxLoader3.datanode;dur=151.274997, PetaboxLoader3.resolve;dur=24.161484
x-app-server: wwwb-app243-dc6
x-ts: 302
x-tr: 299
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app243; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 23 Dec 2025 19:31:51 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Thu, 29 Apr 2010 22:03:19 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "e78a6cd8704ea0170bd32ec50ce7017b"
x-archive-orig-x-runtime: 110ms
x-archive-orig-content-length: 25683
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 29 Apr 2010 22:03:19 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_15_20100429192818_crawl101-c/52_15_20100429220235_crawl101.arc.gz
server-timing: captures_list;dur=0.697776, exclusion.robots;dur=0.035497, exclusion.robots.policy;dur=0.022743, esindex;dur=0.014258, cdx.remote;dur=16.253425, LoadShardBlock;dur=308.808943, PetaboxLoader3.datanode;dur=146.565195, PetaboxLoader3.resolve;dur=407.249380, load_resource;dur=318.772400
x-app-server: wwwb-app243-dc6
x-ts: 200
x-tr: 737
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
intridea's oauth2 at v0.0.5 - GitHub
intridea / oauth2
- Source
- Commits
- Network (8)
- Issues (1)
- Downloads (8)
- Wiki (5)
- Graphs
-
Tag:
v0.0.5
click here to add a description
click here to add a homepage
oauth2 /
| name | age | message | |
|---|---|---|---|
| |
.document | Wed Apr 21 17:22:04 -0700 2010 | Initial commit to oauth2. [mbleigh] |
| |
.gitignore | Wed Apr 21 22:15:09 -0700 2010 | Initial import. [mbleigh] |
| |
LICENSE | Fri Apr 23 16:59:29 -0700 2010 | Update license and README [mbleigh] |
| |
README.rdoc | Fri Apr 23 16:59:29 -0700 2010 | Update license and README [mbleigh] |
| |
Rakefile | Thu Apr 22 09:59:59 -0700 2010 | replace Net::HTTP with Faraday [technoweenie] |
| |
VERSION | Fri Apr 23 17:01:11 -0700 2010 | Version bump to 0.0.5 [mbleigh] |
| |
lib/ | Fri Apr 23 15:03:30 -0700 2010 | quickfix for EOFError on POST, DELETE and PUT r... [timhabermaas] |
| |
oauth2.gemspec | Fri Apr 23 17:01:13 -0700 2010 | Regenerated gemspec for version 0.0.5 [mbleigh] |
| |
spec/ | Fri Apr 23 17:01:07 -0700 2010 | Spec updates for body-based POST-ing [mbleigh] |
| |
specs.watchr | Wed Apr 21 22:15:09 -0700 2010 | Initial import. [mbleigh] |
README.rdoc
OAuth2
A Ruby wrapper for the OAuth 2.0 specification. This is a work in progress, being built first to solve the pragmatic process of connecting to existing OAuth 2.0 endpoints (a.k.a. Facebook) with the goal of building it up to meet the entire specification over time.
Installation
gem install oauth2
Web Server Example (Sinatra)
Below is a fully functional example of a Sinatra application that would authenticate to Facebook utilizing the OAuth 2.0 web server flow.
require 'rubygems'
require 'sinatra'
require 'oauth2'
require 'json'
def client
OAuth2::Client.new('api_key', 'api_secret', :site => 'https://graph.facebook.com')
end
get '/auth/facebook' do
redirect client.web_server.authorize_url(
:redirect_uri => redirect_uri,
:scope => 'email,offline_access'
)
end
get '/auth/facebook/callback' do
access_token = client.web_server.access_token(params[:code], :redirect_uri => redirect_uri)
user = JSON.parse(access_token.get('/me'))
user.inspect
end
def redirect_uri
uri = URI.parse(request.url)
uri.path = '/auth/facebook/callback'
uri.query = nil
uri.to_s
end
That’s all there is to it! You can use the access token like you would with the OAuth gem, calling HTTP verbs on it etc.
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don’t break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2010 Intridea, Inc. and Michael Bleigh. See LICENSE for details.
