Pykih
Pykih

Reputation: 2827

Could not authenticate you from Linkedin because "Invalid credentials"

I have set up DEVISE and OMNIAUTH login. It was working with Facebook. Now I am trying to set it up similarly for LinkedIn. Below is what I have done. However, I am getting following error message - "Could not authenticate you from Linkedin because "Invalid credentials"." Can someone please assist?

Thank you in advance. In case you need more details then let me know.

GEM FILE

gem 'omniauth'
gem 'omniauth-linkedin'
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'

Omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :linkedin, LINKEDIN_APP, LINKEDIN_SECRET
end

Devise.rb

require "omniauth-linkedin"
config.omniauth :linkedin, LINKEDIN_APP, LINKEDIN_SECRET

Where did the get the keys?

  1. Registered a new application at https://www.linkedin.com/secure/developer?newapp=

  2. Got two keys API Key and Secret Key on application show page. Copied them to LINKEDIN_APP, LINKEDIN_SECRET

Upvotes: 3

Views: 3347

Answers (2)

R Milushev
R Milushev

Reputation: 4315

I had almost the same problem with 'omniauth-github' . I hope this post of Ryan Bigg is going to help you. Another simple check is if url and url-callback of the app are there (no localhost:3000 allowed) .

Upvotes: 3

Related Questions