Reputation: 2827
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?
Registered a new application at https://www.linkedin.com/secure/developer?newapp=
Got two keys API Key and Secret Key on application show page. Copied them to LINKEDIN_APP, LINKEDIN_SECRET
Upvotes: 3
Views: 3347
Reputation: 14289
omniauth.rb
is conflicting with devise.rb
as both are interacting with Omniauth. Remove the code in omniauth.rb
.
Explained in Devise documentation:
Similar questions:
Rails: Could not authenticate you from Facebook because "Invalid credentials"
Authentication failure : Devise + OmniAuth + Twitter
Upvotes: 0
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