diff --git a/Gemfile b/Gemfile index 92e92a8..796ccca 100644 --- a/Gemfile +++ b/Gemfile @@ -12,3 +12,5 @@ gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'spring', group: :development + +gem 'omniauth-google-oauth2', '~> 0.2.5' diff --git a/Gemfile.lock b/Gemfile.lock index 066884b..6cb305a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,9 @@ GEM coffee-script-source (1.8.0) erubis (2.7.0) execjs (2.2.1) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + hashie (3.3.1) hike (1.2.3) i18n (0.6.11) jbuilder (2.1.3) @@ -47,11 +50,31 @@ GEM railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) + jwt (1.0.0) mail (2.6.1) mime-types (>= 1.16, < 3) mime-types (2.3) minitest (5.4.2) multi_json (1.10.1) + multi_xml (0.5.5) + multipart-post (2.0.0) + oauth2 (1.0.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (~> 1.2) + omniauth (1.2.2) + hashie (>= 1.2, < 4) + rack (~> 1.0) + omniauth-google-oauth2 (0.2.5) + omniauth (> 1.0) + omniauth-oauth2 (~> 1.1) + omniauth-oauth2 (1.2.0) + faraday (>= 0.8, < 0.10) + multi_json (~> 1.3) + oauth2 (~> 1.0) + omniauth (~> 1.2) rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) @@ -111,6 +134,7 @@ DEPENDENCIES coffee-rails (~> 4.0.0) jbuilder (~> 2.0) jquery-rails + omniauth-google-oauth2 (~> 0.2.5) rails (= 4.1.6) sass-rails (~> 4.0.3) sdoc (~> 0.4.0) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb new file mode 100644 index 0000000..00696e9 --- /dev/null +++ b/config/initializers/omniauth.rb @@ -0,0 +1,14 @@ +OmniAuth.config.logger = Rails.logger + +Rails.application.config.middleware.use OmniAuth::Builder do + provider :google_oauth2, + Rails.application.secrets.google_client_id, + Rails.application.secrets.google_client_secret, + { + client_options: { + ssl: { + ca_file: Rails.root.join('cacert.pem').to_s + } + } + } +end