Skip to content

Instantly share code, notes, and snippets.

@ahmdrefat
Created October 21, 2012 08:20
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 ahmdrefat/3926310 to your computer and use it in GitHub Desktop.
Save ahmdrefat/3926310 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment