Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstractj/4268055 to your computer and use it in GitHub Desktop.
Save abstractj/4268055 to your computer and use it in GitHub Desktop.
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