Skip to content

Instantly share code, notes, and snippets.

@ahmdrefat
Created October 21, 2012 08:22
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/3926311 to your computer and use it in GitHub Desktop.
Save ahmdrefat/3926311 to your computer and use it in GitHub Desktop.
def oauth_account
client = LinkedIn::Client.new('your-api-key', 'your-secret-key', @@config)
pin = params[:oauth_verifier]
if pin
atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)
LinkedinOauthSetting.create!(:asecret => asecret, :atoken => atoken, :user_id => current_user.id)
end
redirect_to "/"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment