Skip to content

Commit

Permalink
update to omniauth 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jxjj committed Dec 30, 2024
1 parent 6031e69 commit 9af99b5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ gem 'passenger', "~> 6.0"
gem 'ajax-datatables-rails', "~> 1.4"

# Use OmniAuth to support any type of auth
gem 'omniauth', "~> 1.9"
gem 'omniauth-shibboleth', "~> 1.1"
gem 'omniauth', "~> 2.0"
gem 'omniauth-rails_csrf_protection', "~> 1.0"
gem 'omniauth-shibboleth-passive', "~> 0.1"
gem 'omniauth-shibboleth-redux', "~> 2.0"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 8.0'
Expand Down
28 changes: 19 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ GEM
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindex (0.8.1)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
Expand Down Expand Up @@ -305,22 +305,28 @@ GEM
net-protocol
net-ssh (7.3.0)
nio4r (2.7.4)
nokogiri (1.17.2-aarch64-linux)
nokogiri (1.18.1-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.17.2-arm64-darwin)
nokogiri (1.18.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
nokogiri (1.18.1-x86_64-linux-gnu)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
omniauth (1.9.2)
omniauth (2.1.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
rack (>= 2.2.3)
rack-protection
omniauth-rails_csrf_protection (1.0.2)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-shibboleth (1.1.2)
omniauth (>= 1.0.0)
omniauth-shibboleth-passive (0.1.0)
omniauth-shibboleth (~> 1.1.0)
omniauth-shibboleth-redux (2.0.0)
omniauth (>= 2.0.0)
ostruct (0.6.1)
paper_trail (16.0.0)
activerecord (>= 6.1)
Expand Down Expand Up @@ -351,11 +357,14 @@ GEM
activesupport (>= 3.0.0)
racc (1.8.1)
rack (2.2.10)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack-test (2.2.0)
rack (>= 1.3)
rack-utf8_sanitizer (1.9.1)
rack (>= 1.0, < 4.0)
Expand Down Expand Up @@ -592,9 +601,10 @@ DEPENDENCIES
lograge (~> 0.11)
mysql2 (~> 0.5)
net-ldap (~> 0.16)
omniauth (~> 1.9)
omniauth-shibboleth (~> 1.1)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (~> 1.0)
omniauth-shibboleth-passive (~> 0.1)
omniauth-shibboleth-redux (~> 2.0)
paper_trail (~> 16.0)
passenger (~> 6.0)
pry (~> 0.13)
Expand Down
1 change: 1 addition & 0 deletions config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

OmniAuth.config.logger = Rails.logger

# permit get requests so that redirects to `/auth/:provider` work
OmniAuth.config.allowed_request_methods = %i[post get]
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

# Handle Auth
post "/auth/:provider/callback", to: "sessions#create"
get "/auth/:provider/callback", to: "sessions#create"

root "home#index"
get "shortener", to: "urls#index"
Expand Down

0 comments on commit 9af99b5

Please sign in to comment.