diff --git a/Gemfile b/Gemfile index 47274d0..6046a8a 100644 --- a/Gemfile +++ b/Gemfile @@ -25,8 +25,9 @@ gem 'hashie' # authentication gem 'devise' -gem 'oa-oauth', :require => 'omniauth/oauth' -gem 'oa-openid', :require => 'omniauth/openid' +gem 'omniauth' +gem 'omniauth-facebook' +gem 'omniauth-openid' # for file upload ( -> avatar ) gem 'paperclip', '~> 2.3' diff --git a/Gemfile.lock b/Gemfile.lock index 8b4a021..70829a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,18 +86,6 @@ GEM multi_json (1.5.0) multipart-post (1.1.5) nokogiri (1.5.6) - oa-core (0.0.5) - rack (~> 1.1) - oa-oauth (0.0.1) - json - nokogiri - oa-core (~> 0.0.0) - oauth - oauth2 - oa-openid (0.0.5) - oa-core (= 0.0.5) - rack-openid (~> 1.1.1) - ruby-openid-apps-discovery oauth (0.4.7) oauth2 (0.8.0) faraday (~> 0.8) @@ -105,6 +93,17 @@ GEM jwt (~> 0.1.4) multi_json (~> 1.0) rack (~> 1.2) + omniauth (1.1.1) + hashie (~> 1.2) + rack + omniauth-facebook (1.4.1) + omniauth-oauth2 (~> 1.1.0) + omniauth-oauth2 (1.1.1) + oauth2 (~> 0.8.0) + omniauth (~> 1.0) + omniauth-openid (1.0.1) + omniauth (~> 1.0) + rack-openid (~> 1.3.1) orm_adapter (0.4.0) paperclip (2.8.0) activerecord (>= 2.3.0) @@ -115,9 +114,9 @@ GEM rack (1.4.1) rack-cache (1.2) rack (>= 0.4) - rack-openid (1.1.2) - rack (>= 0.4) - ruby-openid (>= 2.0.3) + rack-openid (1.3.1) + rack (>= 1.1.0) + ruby-openid (>= 2.1.8) rack-ssl (1.3.2) rack rack-test (0.6.2) @@ -144,8 +143,6 @@ GEM redis-namespace (1.2.1) redis (~> 3.0.0) ruby-openid (2.2.2) - ruby-openid-apps-discovery (1.2.0) - ruby-openid (>= 2.1.7) ruby_parser (3.1.1) sexp_processor (~> 4.1) sass (3.2.4) @@ -195,8 +192,9 @@ DEPENDENCIES jquery-rails (= 1.0.12) json mongrel (= 1.2.0.pre2) - oa-oauth - oa-openid + omniauth + omniauth-facebook + omniauth-openid paperclip (~> 2.3) rails (= 3.2.8) rake diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 6ded5ce..6e764d0 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -78,10 +78,6 @@ Devise.setup do |config| # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false - # If true, uses the password salt as remember token. This should be turned - # to false if you are not using database authenticatable. - config.use_salt_as_remember_token = true - # Options to be passed to the created cookie. For instance, you can set # :secure => true in order to force SSL only cookies. # config.cookie_options = {} @@ -182,7 +178,7 @@ Devise.setup do |config| # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - + if Rails.env.development? or Rails.env.test? config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET'] else @@ -190,9 +186,9 @@ Devise.setup do |config| config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET'] {:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}} end - - config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp') - # config.omniauth :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id' + + config.omniauth :open_id, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'openid' + # config.omniauth :google_apps, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id' # config.omniauth :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET' # ==> Warden configuration