6
6
end
7
7
end
8
8
9
- def post_xml ( xml = :example_response , opts = { } )
9
+ def post_xml ( xml = :example_response , opts = { } )
10
10
post "/auth/saml/callback" , opts . merge ( { 'SAMLResponse' => load_xml ( xml ) } )
11
11
end
12
12
@@ -34,10 +34,10 @@ def post_xml(xml=:example_response, opts = {})
34
34
end
35
35
let ( :strategy ) { [ OmniAuth ::Strategies ::SAML , saml_options ] }
36
36
37
- describe 'GET /auth/saml' do
37
+ describe 'POST /auth/saml' do
38
38
context 'without idp runtime params present' do
39
39
before do
40
- get '/auth/saml'
40
+ post '/auth/saml'
41
41
end
42
42
43
43
it 'should get authentication page' do
@@ -51,7 +51,7 @@ def post_xml(xml=:example_response, opts = {})
51
51
52
52
context 'with idp runtime params' do
53
53
before do
54
- get '/auth/saml' , 'original_param_key' => 'original_param_value' , 'mapped_param_key' => 'mapped_param_value'
54
+ post '/auth/saml' , 'original_param_key' => 'original_param_value' , 'mapped_param_key' => 'mapped_param_value'
55
55
end
56
56
57
57
it 'should get authentication page' do
@@ -71,7 +71,7 @@ def post_xml(xml=:example_response, opts = {})
71
71
72
72
it 'should send the current callback_url as the assertion_consumer_service_url' do
73
73
%w( foo.example.com bar.example.com ) . each do |host |
74
- get "https://#{ host } /auth/saml"
74
+ post "https://#{ host } /auth/saml"
75
75
76
76
expect ( last_response ) . to be_redirect
77
77
@@ -89,7 +89,7 @@ def post_xml(xml=:example_response, opts = {})
89
89
end
90
90
91
91
context 'when authn request signing is requested' do
92
- subject { get '/auth/saml' }
92
+ subject { post '/auth/saml' }
93
93
94
94
let ( :private_key ) { OpenSSL ::PKey ::RSA . new 2048 }
95
95
@@ -402,10 +402,10 @@ def test_default_relay_state(static_default_relay_state = nil, &block_default_re
402
402
end
403
403
end
404
404
405
- describe 'GET /auth/saml/metadata' do
405
+ describe 'POST /auth/saml/metadata' do
406
406
before do
407
407
saml_options [ :issuer ] = 'http://example.com/SAML'
408
- get '/auth/saml/metadata'
408
+ post '/auth/saml/metadata'
409
409
end
410
410
411
411
it 'should get SP metadata page' do
@@ -424,19 +424,19 @@ def test_default_relay_state(static_default_relay_state = nil, &block_default_re
424
424
end
425
425
426
426
context 'when hitting an unknown route in our sub path' do
427
- before { get '/auth/saml/unknown' }
427
+ before { post '/auth/saml/unknown' }
428
428
429
429
specify { expect ( last_response . status ) . to eql 404 }
430
430
end
431
431
432
432
context 'when hitting a completely unknown route' do
433
- before { get '/unknown' }
433
+ before { post '/unknown' }
434
434
435
435
specify { expect ( last_response . status ) . to eql 404 }
436
436
end
437
437
438
438
context 'when hitting a route that contains a substring match for the strategy name' do
439
- before { get '/auth/saml2/metadata' }
439
+ before { post '/auth/saml2/metadata' }
440
440
441
441
it 'should not set the strategy' do
442
442
expect ( last_request . env [ 'omniauth.strategy' ] ) . to be_nil
0 commit comments