hexgnu / linkedin

Ruby wrapper for the LinkedIn API
http://rdoc.info/gems/linkedin
MIT License
756 stars 407 forks source link

Port to OAuth 2 #247

Closed danielfarrell closed 5 years ago

danielfarrell commented 9 years ago

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)
arronmabrey commented 5 years ago

@hexgnu I can confirm that this PR is working, LinkedIn recently required oauth2 for accessing their company endpoints and this patch got things working. What's the likely hood of this PR being merged and a new gem cut and published?

Thanks, -- Arron

ryanatwork commented 5 years ago

I can merge this branch and cut a new gem version. Just need to resolve the conflicts.

ryanatwork commented 5 years ago

Thanks for this PR, I have merged and cut a new version of the gem.

arronmabrey commented 5 years ago

Awesome thanks so much! I had to vender the pr branch to get it all working, relying on a new gem is going to be much better. Thx a ton! :-)

-- Arron

On August 8, 2018 at 11:43:57 AM, Ryan Resella (notifications@github.com) wrote:

Thanks for this PR, I have merged and cut a new version of the gem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hexgnu/linkedin/pull/247#issuecomment-411492085, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH1Kp3dv6tND0ysYWRyJIOqSIsSvK0vks5uOyNdgaJpZM4CycGI .

hexgnu commented 5 years ago

Thanks @ryanatwork