Skip to content

Commit

Permalink
Merge pull request #16 from BobbyMcWho/use-omniauth-2_0_0
Browse files Browse the repository at this point in the history
Use OmniAuth 2.0.0
  • Loading branch information
dandrews authored Mar 25, 2021
2 parents 7246c02 + 3460aec commit bd84810
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/omniauth-okta/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module OmniAuth
module Okta
VERSION = '0.1.3'.freeze
VERSION = '1.0.0'.freeze
end
end
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/okta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def raw_info
end

def callback_url
options[:redirect_uri] || (full_host + script_name + callback_path)
options[:redirect_uri] || (full_host + callback_path)
end

# Returns the qualified URL for the authorization server
Expand Down
5 changes: 2 additions & 3 deletions omniauth-okta.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ Gem::Specification.new do |s|

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

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

s.add_development_dependency "bundler", "~> 1.5"
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 3"
s.add_development_dependency "rack-test"
Expand Down
8 changes: 5 additions & 3 deletions spec/omniauth/strategies/okta_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
require 'spec_helper'

describe OmniAuth::Strategies::Okta do

include OmniAuth::Test::StrategyTestCase
subject { described_class.new({}) }

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

describe '#client' do
it 'has default site' do
Expand Down Expand Up @@ -38,8 +39,9 @@

describe '#callback_path' do
it 'has the correct callback path' do
expect(subject.callback_path).to \
eq('/auth/okta/callback')
post '/auth/okta'
expect(last_response.location).to \
eq('http://example.org/auth/okta/callback')
end
end

Expand Down
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

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

Expand All @@ -20,3 +19,6 @@
# --seed 1234
config.order = 'random'
end

OmniAuth.config.test_mode = true
OmniAuth.config.request_validation_phase = proc {}

0 comments on commit bd84810

Please sign in to comment.