Ruby: Getting salesforce oauth_token -
i have client_id
, client_secret
authenticate, need oauth_token
. how token using ruby on rails? tried few option not work out.
gem used : databasedotcom
i tried below option not responding https://gist.github.com/undees/300175
require 'oauth' consumer_key = '...' # salesforce consumer_secret = '...' # salesforce oauth_options = { :site => 'https://login.salesforce.com', :scheme => :body, :request_token_path => '/_nc_external/system/security/oauth/requesttokenhandler', :authorize_path => '/setup/secur/remoteaccessauthorizationpage.apexp', :access_token_path => '/_nc_external/system/security/oauth/accesstokenhandler', } consumer = oauth::consumer.new consumer_key, consumer_secret, oauth_options # consumer.http.set_debug_output stderr # if you're curious request = consumer.get_request_token authorize_url = request.authorize_url :oauth_consumer_key => consumer_key puts "go #{authorize_url} in browser, enter verification code:" verification_code = gets.strip access = request.get_access_token :oauth_verifier => verification_code puts "access token: " + access.token puts "access secret: " + access.secret
solution: databasedotcom-oauth2 gem worked me. takes client key , secret , interact salesforce. detail given in here. click here http://wiki.developerforce.com/page/introduction_to_the_databasedotcom-oauth2_gem