Skip to content

Commit

Permalink
Add OmniAuth v2 support
Browse files Browse the repository at this point in the history
Close #62
  • Loading branch information
tagliala committed Jan 10, 2024
1 parent 4c25eed commit 435573c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion omniauth-cas.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 3 additions & 5 deletions spec/omniauth/strategies/cas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down Expand Up @@ -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
Expand All @@ -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 }

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 435573c

Please sign in to comment.