diff --git a/Gemfile b/Gemfile index 92c8bd2..053d232 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,9 @@ source 'http://rubygems.org' + gem 'rails', '3.2.1' gem "health-data-standards", :git => "http://github.com/projectcypress/health-data-standards.git", :branch => "develop" +gem 'ruby-openid', :git => 'https://github.com/rdingwell/ruby-openid.git',:branch => "master" gem "mongoid" gem "bson_ext" gem "pry" @@ -10,6 +12,7 @@ gem 'heroku' gem "nokogiri" gem 'devise' gem 'omniauth' +gem 'omniauth-openid' group :assets do @@ -30,4 +33,5 @@ group :test do gem 'turn', :require => false gem 'minitest' gem 'feedzirra' -end \ No newline at end of file +end + diff --git a/Gemfile.lock b/Gemfile.lock index d7ae270..c5472d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,6 +10,13 @@ GIT nokogiri (~> 1.4.7) uuid (~> 2.3.4) +GIT + remote: https://github.com/rdingwell/ruby-openid.git + revision: cc6fa401242190344935fb12a824fa39043cffc7 + branch: master + specs: + ruby-openid (2.1.9) + GEM remote: http://rubygems.org/ specs: @@ -64,9 +71,10 @@ GEM coffee-script-source (1.2.0) curb (0.7.18) daemons (1.1.6) - devise (1.5.3) + devise (2.0.0) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) + railties (~> 3.1) warden (~> 1.1) erubis (2.7.0) eventmachine (0.12.10) @@ -128,6 +136,9 @@ GEM omniauth (1.0.2) hashie (~> 1.2) rack + omniauth-openid (1.0.1) + omniauth (~> 1.0) + rack-openid (~> 1.3.1) orm_adapter (0.0.6) polyglot (0.3.3) pry (0.9.8) @@ -137,6 +148,9 @@ GEM rack (1.4.1) rack-cache (1.1) rack (>= 0.4) + rack-openid (1.3.1) + rack (>= 1.1.0) + ruby-openid (>= 2.1.8) rack-ssl (1.3.2) rack rack-test (0.6.1) @@ -214,8 +228,10 @@ DEPENDENCIES mongoid nokogiri omniauth + omniauth-openid pry rails (= 3.2.1) + ruby-openid! sass-rails (~> 3.2.3) therubyracer thin diff --git a/app/models/user.rb b/app/models/user.rb index fe641df..3d8a2a0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -9,5 +9,5 @@ class User # validates_presence_of :name validates_uniqueness_of :name, :email, :case_sensitive => false attr_accessible :name, :email, :password, :password_confirmation, :remember_me - + has_many :authentications end diff --git a/config/routes.rb b/config/routes.rb index 9c866f4..04dceea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ HdataServer::Application.routes.draw do devise_for :users - + + match '/auth/:provider/callback' => 'authentications#create' + # The priority is based upon order of creation: # first created -> highest priority.