diff --git a/CHANGELOG.md b/CHANGELOG.md index 983626a..2845665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ project adheres to [Semantic Versioning](https://semver.org/) ### Changed +* Breaking change: Support OmniAuth 2 (#82). * Potential breaking change: case of `Omniauth::Cas::VERSION` module (#76). ### Removed diff --git a/README.md b/README.md index c347cb9..4e130f4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [github_actions_status]: https://github.com/dlindahl/omniauth-cas/actions/workflows/ci.yml/badge.svg [releases]: https://github.com/dlindahl/omniauth-cas/releases -This is a [OmniAuth][omniauth] 1.9 compatible port of the previously available +This is a [OmniAuth][omniauth] 2.1+ compatible port of the previously available [OmniAuth CAS strategy][old_omniauth_cas] that was bundled with OmniAuth 0.3. * [View the documentation][document_up] diff --git a/omniauth-cas.gemspec b/omniauth-cas.gemspec index 45e7b60..699b671 100644 --- a/omniauth-cas.gemspec +++ b/omniauth-cas.gemspec @@ -28,5 +28,5 @@ Gem::Specification.new do |gem| gem.add_dependency 'addressable', '~> 2.8' gem.add_dependency 'nokogiri', '~> 1.12' - gem.add_dependency 'omniauth', '~> 1.9' + gem.add_dependency 'omniauth', '~> 2.1' end diff --git a/spec/omniauth/strategies/cas_spec.rb b/spec/omniauth/strategies/cas_spec.rb index 6a272b7..0f734c2 100644 --- a/spec/omniauth/strategies/cas_spec.rb +++ b/spec/omniauth/strategies/cas_spec.rb @@ -38,7 +38,7 @@ let(:redirect_params) { "service=#{Rack::Utils.escape("http://example.org/auth/cas/callback?url=#{Rack::Utils.escape(return_url)}")}" } - before { get url, nil, request_env } + before { post url, nil, request_env } it { is_expected.to be_redirect } @@ -95,7 +95,7 @@ it { is_expected.to include('ssl' => true) } end - describe 'GET /auth/cas' do + describe 'POST /auth/cas' do let(:return_url) { 'http://example.org/admin/foo' } context 'with a referer' do @@ -115,7 +115,7 @@ end end - describe 'GET /auth/cas/callback' do + describe 'POST /auth/cas/callback' do context 'without a ticket' do subject { last_response } @@ -253,9 +253,7 @@ it_behaves_like 'successful validation' end end - end - describe 'POST /auth/cas/callback' do describe 'with a Single Sign-Out logoutRequest' do subject do post 'auth/cas/callback', logoutRequest: logoutRequest diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c7d891b..af9385c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,6 +13,7 @@ require 'webmock/rspec' OmniAuth.config.logger = Logger.new('/dev/null') +OmniAuth.config.request_validation_phase = nil # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.