Skip to content

Commit

Permalink
web: add sign in with apple
Browse files Browse the repository at this point in the history
  • Loading branch information
zacwood9 committed Jan 2, 2024
1 parent 5a93d6c commit 71490d8
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ gem "rest-client", require: false
# Use Sass to process CSS
gem "sassc-rails"

gem "omniauth-apple"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

Expand Down
35 changes: 35 additions & 0 deletions web/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
Expand All @@ -89,6 +90,7 @@ GEM
base64 (0.1.1)
bcrypt (3.1.20)
bigdecimal (3.1.4)
bindata (2.4.15)
bindex (0.8.1)
blueprinter (0.30.0)
bootsnap (1.17.0)
Expand All @@ -113,6 +115,13 @@ GEM
drb (2.1.1)
ruby2_keywords
erubi (1.12.0)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.2)
ffi (1.16.3)
fiber-annotation (0.2.0)
fiber-local (1.0.0)
Expand All @@ -138,6 +147,13 @@ GEM
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.7.1)
json-jwt (1.16.4)
activesupport (>= 4.2)
aes_key_wrap
bindata
faraday (~> 2.0)
faraday-follow_redirects
jwt (2.7.1)
language_server-protocol (3.17.0.3)
loofah (2.21.4)
crass (~> 1.0.2)
Expand All @@ -155,6 +171,7 @@ GEM
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.2)
multi_xml (0.6.0)
mutex_m (0.1.2)
net-imap (0.4.4)
date
Expand All @@ -174,10 +191,23 @@ GEM
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (2.1.1)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-apple (1.3.0)
json-jwt
omniauth-oauth2
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
Expand Down Expand Up @@ -284,6 +314,9 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand All @@ -306,6 +339,7 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
version_gem (1.1.3)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -338,6 +372,7 @@ DEPENDENCIES
importmap-rails
jbuilder
omniauth
omniauth-apple
omniauth-rails_csrf_protection
pg (~> 1.1)
puma (~> 6.0)
Expand Down
5 changes: 5 additions & 0 deletions web/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ class Application < Rails::Application
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

config.action_dispatch.cookies_same_site_protection =
lambda do |request|
request.path.starts_with?("/auth/apple") ? :none : :lax
end
end
end
2 changes: 1 addition & 1 deletion web/config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jZ6hM9vP1z7C5ykx0rvwZEhNeXK/VbNOSfhgy4g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Pwryh46FCedFYBSQTIfkr0FAH204nZW62g4OTt4dwjbNZXTXAgX558Oa1/nhpZ4/XbPFO3WeE5OnxUQjTmB8aFw+7dTegAvjoOSKLr4cqhhTBAlQGkttSFmjE/BzJPVAPMgcsTRZWo5hA0XT49vnfgvU3l8WCCaTHs50f1RHAtSqmD3pzfLhpk7YFStAinNBcXs74DrfnsS--v3N17oqR3MyE4ODY--XTdGTGq5hEiZOpfc1913dQ==
2 changes: 1 addition & 1 deletion web/config/credentials/production.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PfEynluRc170jbfF3A6UroVT72EMLRQVtwNZUJ4mq7EjhWEXjZqPPelECQee54F0vqVgTGn+f49vLj6qZCGGB+AsQCa4ftSJ6st0R3jnXk++vjeGj6wSbf3/uwnuDNb4txk9owc599aB0LCbC1jLn0nyhK/190H5HyNad1FKV7JDoABmTXbmbVDbj4yd4j+qgPHrgvq6H+nSEGakWKAKJX+sVaIt5eHeOvUaRpIV2xieNUXXEqrwazEp5ss1f9zW/bi8Ih0IcWTxBwnG1aerzz4sx1aCZqIyxj+XoW143fEVxaLvcBEubUB9HGhgGUn97dPLklsU+WoJkz3zWhQBlXXfZUjWU3VFE/kE1dFwX9axIq4V+VuVlgttCfkizy71sXQoZisUIqQdjRFyPoc6Mn8wZWgcqZ5yZXRqktl+/a67bHW6PgZypSZLq6knyo/iEiC03eKXFbMu8UqJps81r/Sb9bCCeXfDz17PiOquPK9tDLbIwy41vXUZIHC6n42MdlrlE044Pf6kh5BxtCPxgHXGtJFR+Pi66GQKJ2Que1+AU6cHf81y9Q816aa4ctX3dheauasyzB5hwrcjmpnLJ5IBnxvdhs4CoKp1jGUV5dY8zwxSMFEL2yKnPNZ06VWqk/nhqmcvqvBSRbHNQRJvw2WtmCGFg2Nzgx86X0884usDItvIJpQJ2DBmzmgmJEjUNga8gIPf4wxyAmiq--SHJGfiAfGKqPO3X2--E1KEGRP94E2mIDogwgrBKg==
ptc8lWrq5q7JntOc1moufrtzQ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geK+5AWeMtuqow+hh4MrrHod6GAWnUO9EeO/GjiK+N3dQbwRbszKT1e6NrnCtG8uA0dLuNnfiQI6SPbf2hlRGPrUBkFXZ19exG/8xT7LrHLbXCo2c6FiOpu--XLlKpOHPQTsE1T5D--ksdQSXRxxsEhhnuymtTsLg==
10 changes: 10 additions & 0 deletions web/config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Rails.application.config.middleware.use OmniAuth::Builder do
provider :developer unless Rails.env.production? # You should replace it with your provider

provider :apple,
Rails.application.credentials.dig(:apple, :client_id),
"",
{
scope: "email name",
team_id: Rails.application.credentials.dig(:apple, :team_id),
key_id: Rails.application.credentials.dig(:apple, :key_id),
pem: Rails.application.credentials.dig(:apple, :pem)
}
end

0 comments on commit 71490d8

Please sign in to comment.