1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

Removing rack.auth reference

This commit is contained in:
Michael Bleigh 2010-10-11 11:17:12 -05:00
parent d25178f15e
commit 0eafa3d229

View file

@ -35,10 +35,10 @@ OmniAuth is a collection of Rack middleware. To use a single strategy, you simpl
require 'oa-oauth' require 'oa-oauth'
use OmniAuth::Strategies::Twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET' use OmniAuth::Strategies::Twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
Now to initiate authentication you merely need to redirect the user to `/auth/twitter` via a link or other means. Once the user has authenticated to Twitter, they will be redirected to `/auth/twitter/callback`. You should build an endpoint that handles this URL, at which point you will will have access to the authentication information through the `rack.auth` parameter of the Rack environment. For example, in Sinatra you would do something like this: Now to initiate authentication you merely need to redirect the user to `/auth/twitter` via a link or other means. Once the user has authenticated to Twitter, they will be redirected to `/auth/twitter/callback`. You should build an endpoint that handles this URL, at which point you will will have access to the authentication information through the `omniauth.auth` parameter of the Rack environment. For example, in Sinatra you would do something like this:
get '/auth/twitter/callback' do get '/auth/twitter/callback' do
auth_hash = request.env['rack.auth'] auth_hash = request.env['omniauth.auth']
end end
The hash in question will look something like this: The hash in question will look something like this: