public

  • Download Gist
generate_linkedin_oauth_url.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
def generate_linkedin_oauth_url
if LinkedinOauthSetting.find_by_user_id(current_user.id).nil?
client = LinkedIn::Client.new('your-api-key', 'your-secret-key', @@config)
request_token = client.request_token(:oauth_callback => "http://#{request.host}:#{request.port}/oauth_account")
session[:rtoken] = request_token.token
session[:rsecret] = request_token.secret
redirect_to request_token.authorize_url
else
redirect_to "/oauth_account"
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.