Gazler/Oauth2-Tutorial — Issue #3: update to oauth2 v0.5.1
Author: fluxsaas
Created: 2011-12-04 21:48:37+00:00
State: open

Hey,
i had some problems getting the consumer app up and running with the current oauth2 gem. here is what i have changed:

#### consumer.rb

get '/auth/test' do
redirect client.auth_code.authorize_url(:redirect_uri => redirect_uri)
end

get '/auth/test/callback' do
access_token = client.auth_code.get_token(params[:code], :redirect_uri => redirect_uri )
puts access_token.inspect
session[:access_token] = access_token.token
@message = JSON.parse(access_token.get('/api/users.json').body)
erb :success
end

its the code form the example @ https://github.com/intridea/oauth2