Skip to content

Commit

Permalink
Setup devise with omniauth-cognito-idp
Browse files Browse the repository at this point in the history
Adds devise with an omniauthable strategy using the cognito-idp strategy.

Co-authored-by: Efua Akumanyi <[email protected]>
Co-authored-by: Cait <[email protected]>
  • Loading branch information
2 people authored and Jiv Dhaliwal committed Aug 13, 2020
1 parent 3deb05b commit 8e73f2a
Showing 12 changed files with 470 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM ruby:2.7.1-alpine3.12
ARG BUNDLE_INSTALL_CMD

RUN apk update && apk add --no-cache make

ARG RACK_ENV=development
ARG DB_HOST=db
ARG DB_USER=root
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7'
gem 'bootsnap', '>= 1.4.2', require: false
gem 'tzinfo-data'
gem 'devise'
gem 'omniauth-cognito-idp', '~> 0.1.1'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
37 changes: 37 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ GEM
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
bcrypt (3.1.15)
bindex (0.8.1)
bootsnap (1.4.7)
msgpack (~> 1.0)
@@ -74,19 +75,29 @@ GEM
childprocess (3.0.0)
concurrent-ruby (1.1.6)
crass (1.0.6)
devise (4.7.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.4.4)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.9.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
hashie (4.1.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jwt (2.2.1)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
@@ -103,10 +114,29 @@ GEM
mini_portile2 (2.4.0)
minitest (5.14.1)
msgpack (1.3.3)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.3)
nio4r (2.5.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-cognito-idp (0.1.1)
jwt
omniauth-oauth2
omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1)
omniauth (~> 1.9)
orm_adapter (0.5.0)
public_suffix (4.0.5)
puma (4.3.5)
nio4r (~> 2.0)
@@ -146,6 +176,9 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.7.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
@@ -198,6 +231,8 @@ GEM
thread_safe (~> 0.1)
tzinfo-data (1.2020.1)
tzinfo (>= 1.0.0)
warden (1.2.8)
rack (>= 2.0.6)
web-console (4.0.4)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
@@ -225,10 +260,12 @@ DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
capybara (>= 2.15)
devise
dotenv-rails
jbuilder (~> 2.7)
listen (~> 3.2)
mysql2 (~> 0.5.3)
omniauth-cognito-idp (~> 0.1.1)
puma (~> 4.1)
rails (~> 6.0.3, >= 6.0.3.2)
rspec-rails (~> 4.0.1)
5 changes: 5 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :omniauthable, omniauth_providers: %i[cognito-idp]
end
Loading

0 comments on commit 8e73f2a

Please sign in to comment.