Jibeset
Jibeset.configure do |config|
config.client_id = 'YOUR_CLIENT_ID'
config.client_secret = 'YOUR_CLIENT_SECRET'
config.endpoint = 'http://jibeset.heroku.com/'
config.oauth_callback = 'http://yourapp.example.com/oauth_callback'
end
Authorization Flow
get '/auth/oauth' do
redirect Jibeset.authorize_url
end
get '/auth/oauth/callback' do
response = Jibeset.get_access_token(params[:code], :redirect_uri => oauth_callback)
token = JSON.parse(response.body)["access_token"]
session[:jibeset_token] = token
client = Jibeset.client(:access_token => token)
client.me end