diff --git a/Gemfile b/Gemfile index ef3ba0cf8..1feccb929 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ group :development, :test do gem 'omniauth-facebook' gem 'omniauth-github' gem 'omniauth-google-oauth2' + gem 'omniauth-apple' gem 'rack-cors' gem 'thor' diff --git a/devise_token_auth.gemspec b/devise_token_auth.gemspec index 5fc494465..0f8c0818f 100644 --- a/devise_token_auth.gemspec +++ b/devise_token_auth.gemspec @@ -23,11 +23,12 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.2.0" s.add_dependency 'rails', '>= 4.2.0', '< 6.1' + s.add_dependency 'sprockets', '3.7.2' # FIXME: breaking changes in 4.0.0 s.add_dependency 'devise', '> 3.5.2', '< 5' s.add_dependency 'bcrypt', '~> 3.0' s.add_development_dependency 'appraisal' - s.add_development_dependency 'sqlite3', '~> 1.3.6' + s.add_development_dependency 'sqlite3', '~> 1.4' s.add_development_dependency 'pg' s.add_development_dependency 'mysql2' s.add_development_dependency 'mongoid', '>= 4', '< 8' diff --git a/docs/config/omniauth.md b/docs/config/omniauth.md index 4c6146b3d..424d7fbbe 100644 --- a/docs/config/omniauth.md +++ b/docs/config/omniauth.md @@ -4,11 +4,12 @@ If you wish to use omniauth authentication, add all of your desired authentication provider gems to your `Gemfile`. -**OmniAuth example using github, facebook, and google**: +**OmniAuth example using GitHub, Facebook, Google, and Apple**: ~~~ruby gem 'omniauth-github' gem 'omniauth-facebook' gem 'omniauth-google-oauth2' +gem 'omniauth-apple' ~~~ Then run `bundle install`. @@ -21,13 +22,14 @@ In `config/initializers/omniauth.rb`, add the settings for each of your provider These settings must be obtained from the providers themselves. -**Example using github, facebook, and google**: +**Example using Github, Facebook, Google, and Apple**: ~~~ruby # config/initializers/omniauth.rb Rails.application.config.middleware.use OmniAuth::Builder do provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: 'email,profile' provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'] provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'] + provider :apple, ENV['APPLE_CLIENT_ID'], '', { scope: 'email name', team_id: ENV['APPLE_TEAM_ID'], key_id: ENV['APPLE_KEY'], pem: ENV['APPLE_PEM'] } end ~~~ diff --git a/gemfiles/rails_4_2.gemfile b/gemfiles/rails_4_2.gemfile index 820cb52b4..192ba55d0 100644 --- a/gemfiles/rails_4_2.gemfile +++ b/gemfiles/rails_4_2.gemfile @@ -13,6 +13,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_4_2_mongoid_5.gemfile b/gemfiles/rails_4_2_mongoid_5.gemfile index 9a90814ec..80a6d10a9 100644 --- a/gemfiles/rails_4_2_mongoid_5.gemfile +++ b/gemfiles/rails_4_2_mongoid_5.gemfile @@ -12,6 +12,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_0.gemfile b/gemfiles/rails_5_0.gemfile index 205fa075c..e19e94884 100644 --- a/gemfiles/rails_5_0.gemfile +++ b/gemfiles/rails_5_0.gemfile @@ -13,6 +13,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_1.gemfile b/gemfiles/rails_5_1.gemfile index b2d5faf18..2606dcd56 100644 --- a/gemfiles/rails_5_1.gemfile +++ b/gemfiles/rails_5_1.gemfile @@ -13,6 +13,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_1_mongoid_6.gemfile b/gemfiles/rails_5_1_mongoid_6.gemfile index fbf91c01b..5367006df 100644 --- a/gemfiles/rails_5_1_mongoid_6.gemfile +++ b/gemfiles/rails_5_1_mongoid_6.gemfile @@ -12,6 +12,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_1_mongoid_7.gemfile b/gemfiles/rails_5_1_mongoid_7.gemfile index bb7e8c64c..d3e0d6aef 100644 --- a/gemfiles/rails_5_1_mongoid_7.gemfile +++ b/gemfiles/rails_5_1_mongoid_7.gemfile @@ -12,6 +12,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile index ec8ab0157..c40d78a36 100644 --- a/gemfiles/rails_5_2.gemfile +++ b/gemfiles/rails_5_2.gemfile @@ -13,6 +13,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_2_mongoid_6.gemfile b/gemfiles/rails_5_2_mongoid_6.gemfile index 07d104e8c..14bad1c02 100644 --- a/gemfiles/rails_5_2_mongoid_6.gemfile +++ b/gemfiles/rails_5_2_mongoid_6.gemfile @@ -12,6 +12,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/gemfiles/rails_5_2_mongoid_7.gemfile b/gemfiles/rails_5_2_mongoid_7.gemfile index 9ce48499c..4bf9cb494 100644 --- a/gemfiles/rails_5_2_mongoid_7.gemfile +++ b/gemfiles/rails_5_2_mongoid_7.gemfile @@ -12,6 +12,7 @@ group :development, :test do gem "omniauth-facebook", git: "https://github.com/mkdynamic/omniauth-facebook" gem "omniauth-github", git: "https://github.com/intridea/omniauth-github" gem "omniauth-google-oauth2", git: "https://github.com/zquestz/omniauth-google-oauth2" + gem 'omniauth-apple' gem "rack-cors", require: "rack/cors" gem "thor" gem "database_cleaner" diff --git a/test/dummy/config/initializers/figaro.rb b/test/dummy/config/initializers/figaro.rb index 77000b344..08a045fc1 100644 --- a/test/dummy/config/initializers/figaro.rb +++ b/test/dummy/config/initializers/figaro.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -#Figaro.require("GITHUB_KEY", "GITHUB_SECRET", "FACEBOOK_KEY", "FACEBOOK_SECRET", "GOOGLE_KEY", "GOOGLE_SECRET") +#Figaro.require("GITHUB_KEY", "GITHUB_SECRET", "FACEBOOK_KEY", "FACEBOOK_SECRET", "GOOGLE_KEY", "GOOGLE_SECRET", "APPLE_CLIENT_ID", "APPLE_TEAM_ID", "APPLE_KEY", "APPLE_PEM") diff --git a/test/dummy/config/initializers/omniauth.rb b/test/dummy/config/initializers/omniauth.rb index e495f2364..199e57271 100644 --- a/test/dummy/config/initializers/omniauth.rb +++ b/test/dummy/config/initializers/omniauth.rb @@ -4,6 +4,7 @@ provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: 'email,profile' provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'] provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'] + provider :apple, ENV['APPLE_CLIENT_ID'], '', { scope: 'email name', team_id: ENV['APPLE_TEAM_ID'], key_id: ENV['APPLE_KEY'], pem: ENV['APPLE_PEM'] } provider :developer, fields: [:first_name, :last_name], uid_field: :last_name