hexgnu/linkedin — pull request #247 by danielfarrell (2014-10-23 23:19:29+00:00)
Title: Port to  OAuth 2

I'd be interested in other people trying out this branch and see if it makes sense and works as expected. I was able to do the requests I was doing before with it.

I used it like this:

# Request method
client = LinkedIn::Client.new(ENV["LINKEDIN_API"], ENV["LINKEDIN_SECRET"])
session[:linkedin_state] = SecureRandom.uuid
redirect_to client.authorize_url(redirect_uri: linkedin_auth_callback_url, state: session[:linkedin_state])

# Callback method, should check the state set above on response
client = LinkedIn::Client.new(ENV["LINKEDIN_API"], ENV["LINKEDIN_SECRET"])
token = client.authorize_from_request(params[:code], redirect_uri: linkedin_auth_callback_url)