1
votes

I am trying to set up an authentication using using omniauth via linkedin. I am trying to follow the railscast #241 (Simple OmniAuth). Unfortunately I keep getting an error when I start my rails server in my local environment:

/Users/steve/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/omniauth-1.0.2/lib/omniauth/builder.rb:33:in `rescue in provider': Could not find matching strategy for :linked_in. You may need to install an additional gem (such as omniauth-linked_in). (LoadError)

Gemfile

source 'http://rubygems.org'
gem 'rails', '3.0.11'
gem 'omniauth'
gem 'sqlite3

Congfig/Initializer/Omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :linked_in, 'CONSUMER_KEY', 'CONSUMER_SECRET'
end

I'm just a newbie so if not sure if other info is needed to clarify issue. Thanks Steve

2

2 Answers

1
votes

I think the error message has it for you: "You may need to install an additional gem (such as omniauth-linked_in)" Check out omniauth-linked_in and see if that solves it for you.

1
votes

the omniauth.rb file should be like the following. ( not like linked_in)

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :linkedIn, 'CONSUMER_KEY', 'CONSUMER_SECRET'
end

Please read omniauth-linkedin! before you start to working on these.