Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'rubygems'
require 'rack/oauth2'
client = Rack::OAuth2::Client.new(
:identifier => YOUR_CLIENT_ID,
:secret => YOUR_CLIENT_SECRET,
:redirect_uri => YOUR_REDIRECT_URI, # only required for grant_type = :code
:host => 'rack-oauth2-sample.heroku.com'
)
request_type = :token
puts "## request_type = :#{request_type}"
authorization_uri = case request_type
when :code
client.authorization_uri(:scope => :user_about_me)
when :token
client.authorization_uri(:response_type => :token, :scope => :user_about_me)
end
puts authorization_uri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment