Skip to content

Commit bd84810

Browse files
authored
Merge pull request #16 from BobbyMcWho/use-omniauth-2_0_0
Use OmniAuth 2.0.0
2 parents 7246c02 + 3460aec commit bd84810

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

lib/omniauth-okta/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module OmniAuth
44
module Okta
5-
VERSION = '0.1.3'.freeze
5+
VERSION = '1.0.0'.freeze
66
end
77
end

lib/omniauth/strategies/okta.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def raw_info
7272
end
7373

7474
def callback_url
75-
options[:redirect_uri] || (full_host + script_name + callback_path)
75+
options[:redirect_uri] || (full_host + callback_path)
7676
end
7777

7878
# Returns the qualified URL for the authorization server

omniauth-okta.gemspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ Gem::Specification.new do |s|
1414

1515
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
1616

17-
s.add_dependency "omniauth", "~> 1.5"
18-
s.add_dependency "omniauth-oauth2", ">= 1.6.0", "< 2.0"
17+
s.add_dependency "omniauth", "~> 2.0"
18+
s.add_dependency "omniauth-oauth2", "~> 1.7", ">= 1.7.1"
1919

20-
s.add_development_dependency "bundler", "~> 1.5"
2120
s.add_development_dependency "rake"
2221
s.add_development_dependency "rspec", "~> 3"
2322
s.add_development_dependency "rack-test"

spec/omniauth/strategies/okta_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
require 'spec_helper'
44

55
describe OmniAuth::Strategies::Okta do
6-
6+
include OmniAuth::Test::StrategyTestCase
77
subject { described_class.new({}) }
88

99
let(:base_url) { 'https://your-org.okta.com' }
10+
let(:strategy) { described_class }
1011

1112
describe '#client' do
1213
it 'has default site' do
@@ -38,8 +39,9 @@
3839

3940
describe '#callback_path' do
4041
it 'has the correct callback path' do
41-
expect(subject.callback_path).to \
42-
eq('/auth/okta/callback')
42+
post '/auth/okta'
43+
expect(last_response.location).to \
44+
eq('http://example.org/auth/okta/callback')
4345
end
4446
end
4547

spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
99
RSpec.configure do |config|
10-
config.treat_symbols_as_metadata_keys_with_true_values = true
1110
config.run_all_when_everything_filtered = true
1211
config.filter_run :focus
1312

@@ -20,3 +19,6 @@
2019
# --seed 1234
2120
config.order = 'random'
2221
end
22+
23+
OmniAuth.config.test_mode = true
24+
OmniAuth.config.request_validation_phase = proc {}

0 commit comments

Comments
 (0)