ruby-saml 0.8.14 → 0.8.18
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ruby-saml might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/lib/onelogin/ruby-saml/authrequest.rb +5 -1
- data/lib/onelogin/ruby-saml/logoutrequest.rb +7 -2
- data/lib/onelogin/ruby-saml/logoutresponse.rb +19 -27
- data/lib/onelogin/ruby-saml/response.rb +104 -15
- data/lib/onelogin/ruby-saml/settings.rb +28 -10
- data/lib/onelogin/ruby-saml/slo_logoutrequest.rb +112 -0
- data/lib/onelogin/ruby-saml/slo_logoutresponse.rb +21 -13
- data/lib/onelogin/ruby-saml/utils.rb +27 -0
- data/lib/onelogin/ruby-saml/version.rb +1 -1
- data/lib/ruby-saml.rb +1 -0
- data/lib/xml_security.rb +5 -1
- data/test/certificates/certificate.der +0 -0
- data/test/certificates/formatted_certificate +14 -0
- data/test/certificates/formatted_chained_certificate +42 -0
- data/test/certificates/formatted_private_key +12 -0
- data/test/certificates/formatted_rsa_private_key +12 -0
- data/test/certificates/invalid_certificate1 +1 -0
- data/test/certificates/invalid_certificate2 +1 -0
- data/test/certificates/invalid_certificate3 +12 -0
- data/test/certificates/invalid_chained_certificate1 +1 -0
- data/test/certificates/invalid_private_key1 +1 -0
- data/test/certificates/invalid_private_key2 +1 -0
- data/test/certificates/invalid_private_key3 +10 -0
- data/test/certificates/invalid_rsa_private_key1 +1 -0
- data/test/certificates/invalid_rsa_private_key2 +1 -0
- data/test/certificates/invalid_rsa_private_key3 +10 -0
- data/test/logoutrequest_test.rb +11 -0
- data/test/logoutresponse_test.rb +10 -17
- data/test/request_test.rb +10 -0
- data/test/requests/logoutrequest_fixtures.rb +47 -0
- data/test/response_test.rb +60 -0
- data/test/responses/invalids/invalid_issuer_assertion.xml.base64 +1 -0
- data/test/responses/invalids/invalid_issuer_message.xml.base64 +1 -0
- data/test/responses/logoutresponse_fixtures.rb +7 -6
- data/test/settings_test.rb +106 -0
- data/test/slo_logoutrequest_test.rb +73 -0
- data/test/slo_logoutresponse_test.rb +19 -0
- data/test/utils_test.rb +191 -1
- data/test/xml_security_test.rb +5 -0
- metadata +57 -24
@@ -0,0 +1,42 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE
|
3
|
+
BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh
|
4
|
+
MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIx
|
5
|
+
wsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNz
|
6
|
+
c28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkq
|
7
|
+
hkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jC
|
8
|
+
mdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw
|
9
|
+
Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N
|
10
|
+
4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G
|
11
|
+
CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ
|
12
|
+
+4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1
|
13
|
+
2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ
|
14
|
+
-----END CERTIFICATE-----
|
15
|
+
-----BEGIN CERTIFICATE-----
|
16
|
+
M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9+tm1jrQnL+AAw7JzUht
|
3
|
+
YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR
|
4
|
+
hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR
|
5
|
+
O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3
|
6
|
+
B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe
|
7
|
+
3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL
|
8
|
+
d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO
|
9
|
+
5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK
|
10
|
+
GeW2AKaE6oqRqeVwGw4V
|
data/test/logoutrequest_test.rb
CHANGED
@@ -240,5 +240,16 @@ class LogoutRequestTest < Minitest::Test
|
|
240
240
|
assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string)
|
241
241
|
end
|
242
242
|
end
|
243
|
+
|
244
|
+
describe "#manipulate request_id" do
|
245
|
+
it "be able to modify the request id" do
|
246
|
+
logoutrequest = OneLogin::RubySaml::Logoutrequest.new
|
247
|
+
request_id = logoutrequest.request_id
|
248
|
+
assert_equal request_id, logoutrequest.uuid
|
249
|
+
logoutrequest.uuid = "new_uuid"
|
250
|
+
assert_equal logoutrequest.request_id, logoutrequest.uuid
|
251
|
+
assert_equal "new_uuid", logoutrequest.request_id
|
252
|
+
end
|
253
|
+
end
|
243
254
|
end
|
244
255
|
end
|
data/test/logoutresponse_test.rb
CHANGED
@@ -32,12 +32,12 @@ class LogoutResponseTest < Minitest::Test
|
|
32
32
|
describe "#validate" do
|
33
33
|
it "validate the response" do
|
34
34
|
in_relation_to_request_id = random_id
|
35
|
-
|
36
|
-
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_response({:
|
35
|
+
settings.idp_entity_id = "https://example.com/idp"
|
36
|
+
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_response({:uuid2 => in_relation_to_request_id}), settings)
|
37
37
|
|
38
38
|
assert logoutresponse.validate
|
39
39
|
|
40
|
-
assert_equal settings.
|
40
|
+
assert_equal settings.idp_entity_id, logoutresponse.issuer
|
41
41
|
assert_equal in_relation_to_request_id, logoutresponse.in_response_to
|
42
42
|
|
43
43
|
assert logoutresponse.success?
|
@@ -87,20 +87,6 @@ class LogoutResponseTest < Minitest::Test
|
|
87
87
|
assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate! }
|
88
88
|
end
|
89
89
|
|
90
|
-
it "raise validation error when in bad state" do
|
91
|
-
# no settings
|
92
|
-
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_response)
|
93
|
-
assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate! }
|
94
|
-
end
|
95
|
-
|
96
|
-
it "raise validation error when in lack of sp_entity_id setting" do
|
97
|
-
bad_settings = settings
|
98
|
-
bad_settings.issuer = nil
|
99
|
-
bad_settings.sp_entity_id = nil
|
100
|
-
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_response, bad_settings)
|
101
|
-
assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate! }
|
102
|
-
end
|
103
|
-
|
104
90
|
it "raise error for invalid xml" do
|
105
91
|
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(invalid_xml_response, settings)
|
106
92
|
|
@@ -108,5 +94,12 @@ class LogoutResponseTest < Minitest::Test
|
|
108
94
|
end
|
109
95
|
end
|
110
96
|
|
97
|
+
describe "#response_id" do
|
98
|
+
it "extract the value of the Response ID" do
|
99
|
+
logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_response, settings)
|
100
|
+
assert_equal "_28024690-000e-0130-b6d2-38f6b112be8b", logoutresponse.response_id
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
111
104
|
end
|
112
105
|
end
|
data/test/request_test.rb
CHANGED
@@ -224,6 +224,16 @@ class RequestTest < Minitest::Test
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
227
|
+
describe "#manipulate request_id" do
|
228
|
+
it "be able to modify the request id" do
|
229
|
+
authnrequest = OneLogin::RubySaml::Authrequest.new
|
230
|
+
request_id = authnrequest.request_id
|
231
|
+
assert_equal request_id, authnrequest.uuid
|
232
|
+
authnrequest.uuid = "new_uuid"
|
233
|
+
assert_equal authnrequest.request_id, authnrequest.uuid
|
234
|
+
assert_equal "new_uuid", authnrequest.request_id
|
235
|
+
end
|
236
|
+
end
|
227
237
|
end
|
228
238
|
|
229
239
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
|
3
|
+
def default_request_opts
|
4
|
+
{
|
5
|
+
:uuid => "_28024690-000e-0130-b6d2-38f6b112be8b",
|
6
|
+
:issue_instant => Time.now.strftime('%Y-%m-%dT%H:%M:%SZ'),
|
7
|
+
:nameid => "testuser@example.com",
|
8
|
+
:nameid_format => "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
|
9
|
+
:settings => settings
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def valid_request(opts = {})
|
14
|
+
opts = default_request_opts.merge!(opts)
|
15
|
+
|
16
|
+
"<samlp:LogoutRequest
|
17
|
+
xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
18
|
+
xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\"
|
19
|
+
ID=\"#{opts[:uuid]}\" Version=\"2.0\"
|
20
|
+
IssueInstant=\"#{opts[:issue_instant]}\"
|
21
|
+
Destination=\"#{opts[:settings].idp_slo_target_url}\">
|
22
|
+
<saml:Issuer>#{opts[:settings].idp_entity_id}</saml:Issuer>
|
23
|
+
<saml:NameID Format=\"#{opts[:nameid_format]}\">#{opts[:nameid]}</saml:NameID>
|
24
|
+
</samlp:LogoutRequest>"
|
25
|
+
end
|
26
|
+
|
27
|
+
def invalid_xml_request
|
28
|
+
"<samlp:SomethingAwful
|
29
|
+
xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
30
|
+
ID=\"#{random_id}\" Version=\"2.0\">
|
31
|
+
</samlp:SomethingAwful>"
|
32
|
+
end
|
33
|
+
|
34
|
+
def settings
|
35
|
+
@settings ||= OneLogin::RubySaml::Settings.new(
|
36
|
+
{
|
37
|
+
:assertion_consumer_service_url => "http://app.muda.no/sso/consume",
|
38
|
+
:single_logout_service_url => "http://app.muda.no/sso/consume_logout",
|
39
|
+
:sp_entity_id => "http://app.muda.no",
|
40
|
+
:sp_name_qualifier => "http://sso.muda.no",
|
41
|
+
:idp_sso_target_url => "http://sso.muda.no/sso",
|
42
|
+
:idp_slo_target_url => "http://sso.muda.no/slo",
|
43
|
+
:idp_cert_fingerprint => "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00",
|
44
|
+
:name_identifier_format => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient",
|
45
|
+
}
|
46
|
+
)
|
47
|
+
end
|
data/test/response_test.rb
CHANGED
@@ -229,6 +229,17 @@ class ResponseTest < Minitest::Test
|
|
229
229
|
assert response.validate!
|
230
230
|
end
|
231
231
|
|
232
|
+
it "support signature elements with no KeyInfo if cert provided as text" do
|
233
|
+
response = OneLogin::RubySaml::Response.new(response_document_valid_signed_without_x509certificate)
|
234
|
+
response.stubs(:conditions).returns(nil)
|
235
|
+
settings = OneLogin::RubySaml::Settings.new
|
236
|
+
response.settings = settings
|
237
|
+
settings.idp_cert = ruby_saml_cert_text
|
238
|
+
settings.idp_cert_fingerprint = nil
|
239
|
+
XMLSecurity::SignedDocument.any_instance.expects(:validate_signature).returns(true)
|
240
|
+
assert response.validate!
|
241
|
+
end
|
242
|
+
|
232
243
|
it "returns an error if the signature contains no KeyInfo, cert is not provided and soft" do
|
233
244
|
response = OneLogin::RubySaml::Response.new(response_document_valid_signed_without_x509certificate)
|
234
245
|
response.stubs(:conditions).returns(nil)
|
@@ -312,6 +323,31 @@ class ResponseTest < Minitest::Test
|
|
312
323
|
end
|
313
324
|
end
|
314
325
|
|
326
|
+
describe "#validate_issuer" do
|
327
|
+
it "return true when the issuer of the Message/Assertion matches the IdP entityId" do
|
328
|
+
response = OneLogin::RubySaml::Response.new(response_document_valid_signed)
|
329
|
+
response.settings = settings
|
330
|
+
assert response.send(:validate_issuer)
|
331
|
+
|
332
|
+
response.settings.idp_entity_id = 'https://app.onelogin.com/saml2'
|
333
|
+
assert response.send(:validate_issuer)
|
334
|
+
end
|
335
|
+
|
336
|
+
it "return false when the issuer of the Message does not match the IdP entityId" do
|
337
|
+
response = OneLogin::RubySaml::Response.new(read_invalid_response("invalid_issuer_message.xml.base64"))
|
338
|
+
response.settings = settings
|
339
|
+
response.settings.idp_entity_id = 'http://idp.example.com/'
|
340
|
+
assert !response.send(:validate_issuer)
|
341
|
+
end
|
342
|
+
|
343
|
+
it "return false when the issuer of the Assertion does not match the IdP entityId" do
|
344
|
+
response = OneLogin::RubySaml::Response.new(read_invalid_response("invalid_issuer_assertion.xml.base64"))
|
345
|
+
response.settings = settings
|
346
|
+
response.settings.idp_entity_id = 'http://idp.example.com/'
|
347
|
+
assert !response.send(:validate_issuer)
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
315
351
|
describe "#name_id" do
|
316
352
|
it "extract the value of the name id element" do
|
317
353
|
response = OneLogin::RubySaml::Response.new(response_document)
|
@@ -332,6 +368,30 @@ class ResponseTest < Minitest::Test
|
|
332
368
|
end
|
333
369
|
end
|
334
370
|
|
371
|
+
describe "#name_id_format" do
|
372
|
+
it "extract the value of the name id element" do
|
373
|
+
response = OneLogin::RubySaml::Response.new(response_document)
|
374
|
+
response_signed = OneLogin::RubySaml::Response.new(response_document_valid_signed)
|
375
|
+
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response.name_id_format
|
376
|
+
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response_signed.name_id_format
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
describe "#sessionindex" do
|
381
|
+
it "extract the value of the sessionindex element" do
|
382
|
+
response = OneLogin::RubySaml::Response.new(fixture(:simple_saml_php))
|
383
|
+
assert_equal "_51be37965feb5579d803141076936dc2e9d1d98ebf", response.sessionindex
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
describe "#response_id and assertion_id" do
|
388
|
+
it "extract the value of the Response and Assertion IDs" do
|
389
|
+
response = OneLogin::RubySaml::Response.new(response_document)
|
390
|
+
assert_equal "GOSAMLR12901174571794", response.response_id
|
391
|
+
assert_equal "pfxa46574df-b3b0-a06a-23c8-636413198772", response.assertion_id
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
335
395
|
describe "#check_conditions" do
|
336
396
|
it "check time conditions" do
|
337
397
|
response = OneLogin::RubySaml::Response.new(response_document)
|
@@ -0,0 +1 @@
|
|
1
|
+
nVdbc6rKEn4/Vec/WK7HlOEuYiXZZwQ1XlARNCYvp2AYBOUmg4L++j3gJSYm2Xutp8Se7p7v+3pmunn4Kw/8yg4l2IvCxypzT1f/evrvfx6wGfhxc4pwHIUYVYhTiJuF8bG6TcJmZGIPN0MzQLiZwqYO1GGTvaebJsYoSUmq6lVI/HNMnERpBCO/WlEQTr3QTEsobprGTYrC6dZx7mEUUCi048gLU3z1nwnxfezG1UpPeazGTm41oAAFTqpZdVGqOQjaNQfaXI3nHUTWeIllG8Q5PBMzosfq/wXRgpYj0jXRYpwazbCoBhssUxMbLFlgOMviiiCMt6gX4tQM08cqSzNMja7XGNFg+KbANxn+rVqZn3UkvKpExkqlFLJZxiZPJ0qeHd+j3AxiH5XEHqhrpwcbN3VvSWTYJmfhbXzRI8uy+4y7j5IlxdI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=> "_48024690-100e-1130-e6d2-28f6b112be71",
|
6
7
|
:issue_instant => Time.now.strftime('%Y-%m-%dT%H:%M:%SZ'),
|
7
8
|
:settings => settings
|
8
9
|
}
|
@@ -13,11 +14,11 @@ def valid_response(opts = {})
|
|
13
14
|
|
14
15
|
"<samlp:LogoutResponse
|
15
16
|
xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
16
|
-
ID=\"#{
|
17
|
+
ID=\"#{opts[:uuid]}\" Version=\"2.0\"
|
17
18
|
IssueInstant=\"#{opts[:issue_instant]}\"
|
18
|
-
Destination=\"#{opts[:settings].
|
19
|
-
InResponseTo=\"#{opts[:
|
20
|
-
<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{opts[:settings].
|
19
|
+
Destination=\"#{opts[:settings].idp_slo_target_url}\"
|
20
|
+
InResponseTo=\"#{opts[:uuid2]}\">
|
21
|
+
<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{opts[:settings].idp_entity_id}</saml:Issuer>
|
21
22
|
<samlp:Status xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">
|
22
23
|
<samlp:StatusCode xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
23
24
|
Value=\"urn:oasis:names:tc:SAML:2.0:status:Success\">
|
@@ -33,9 +34,9 @@ def unsuccessful_response(opts = {})
|
|
33
34
|
xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
34
35
|
ID=\"#{random_id}\" Version=\"2.0\"
|
35
36
|
IssueInstant=\"#{opts[:issue_instant]}\"
|
36
|
-
Destination=\"#{opts[:settings].
|
37
|
+
Destination=\"#{opts[:settings].idp_slo_target_url}\"
|
37
38
|
InResponseTo=\"#{opts[:uuid]}\">
|
38
|
-
<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{opts[:settings].
|
39
|
+
<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{opts[:settings].idp_entity_id}</saml:Issuer>
|
39
40
|
<samlp:Status xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">
|
40
41
|
<samlp:StatusCode xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"
|
41
42
|
Value=\"urn:oasis:names:tc:SAML:2.0:status:Requester\">
|
data/test/settings_test.rb
CHANGED
@@ -42,6 +42,112 @@ class SettingsTest < Minitest::Test
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
describe "#get_idp_cert" do
|
46
|
+
it "returns nil when the cert is an empty string" do
|
47
|
+
@settings.idp_cert = ""
|
48
|
+
assert_nil @settings.get_idp_cert
|
49
|
+
end
|
50
|
+
|
51
|
+
it "returns nil when the cert is nil" do
|
52
|
+
@settings.idp_cert = nil
|
53
|
+
assert_nil @settings.get_idp_cert
|
54
|
+
end
|
55
|
+
|
56
|
+
it "returns the certificate when it is valid" do
|
57
|
+
@settings.idp_cert = ruby_saml_cert_text
|
58
|
+
assert @settings.get_idp_cert.kind_of? OpenSSL::X509::Certificate
|
59
|
+
end
|
60
|
+
|
61
|
+
it "raises when the certificate is not valid" do
|
62
|
+
# formatted but invalid cert
|
63
|
+
@settings.idp_cert = read_certificate("formatted_certificate")
|
64
|
+
assert_raises(OpenSSL::X509::CertificateError) {
|
65
|
+
@settings.get_idp_cert
|
66
|
+
}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "#get_sp_cert" do
|
71
|
+
it "returns nil when the cert is an empty string" do
|
72
|
+
@settings.certificate = ""
|
73
|
+
assert_nil @settings.get_sp_cert
|
74
|
+
end
|
75
|
+
|
76
|
+
it "returns nil when the cert is nil" do
|
77
|
+
@settings.certificate = nil
|
78
|
+
assert_nil @settings.get_sp_cert
|
79
|
+
end
|
80
|
+
|
81
|
+
it "returns the certificate when it is valid" do
|
82
|
+
@settings.certificate = ruby_saml_cert_text
|
83
|
+
assert @settings.get_sp_cert.kind_of? OpenSSL::X509::Certificate
|
84
|
+
end
|
85
|
+
|
86
|
+
it "raises when the certificate is not valid" do
|
87
|
+
# formatted but invalid cert
|
88
|
+
@settings.certificate = read_certificate("formatted_certificate")
|
89
|
+
assert_raises(OpenSSL::X509::CertificateError) {
|
90
|
+
@settings.get_sp_cert
|
91
|
+
}
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "#get_sp_key" do
|
96
|
+
it "returns nil when the private key is an empty string" do
|
97
|
+
@settings.private_key = ""
|
98
|
+
assert_nil @settings.get_sp_key
|
99
|
+
end
|
100
|
+
|
101
|
+
it "returns nil when the private key is nil" do
|
102
|
+
@settings.private_key = nil
|
103
|
+
assert_nil @settings.get_sp_key
|
104
|
+
end
|
105
|
+
|
106
|
+
it "returns the private key when it is valid" do
|
107
|
+
@settings.private_key = ruby_saml_key_text
|
108
|
+
assert @settings.get_sp_key.kind_of? OpenSSL::PKey::RSA
|
109
|
+
end
|
110
|
+
|
111
|
+
it "raises when the private key is not valid" do
|
112
|
+
# formatted but invalid rsa private key
|
113
|
+
@settings.private_key = read_certificate("formatted_rsa_private_key")
|
114
|
+
assert_raises(OpenSSL::PKey::RSAError) {
|
115
|
+
@settings.get_sp_key
|
116
|
+
}
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#get_fingerprint" do
|
122
|
+
it "get the fingerprint value when cert and fingerprint in settings are nil" do
|
123
|
+
@settings.idp_cert_fingerprint = nil
|
124
|
+
@settings.idp_cert = nil
|
125
|
+
fingerprint = @settings.get_fingerprint
|
126
|
+
assert_nil fingerprint
|
127
|
+
end
|
128
|
+
|
129
|
+
it "get the fingerprint value when there is a cert at the settings" do
|
130
|
+
@settings.idp_cert_fingerprint = nil
|
131
|
+
@settings.idp_cert = ruby_saml_cert_text
|
132
|
+
fingerprint = @settings.get_fingerprint
|
133
|
+
assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase
|
134
|
+
end
|
135
|
+
|
136
|
+
it "get the fingerprint value when there is a fingerprint at the settings" do
|
137
|
+
@settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint
|
138
|
+
@settings.idp_cert = nil
|
139
|
+
fingerprint = @settings.get_fingerprint
|
140
|
+
assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase
|
141
|
+
end
|
142
|
+
|
143
|
+
it "get the fingerprint value when there are cert and fingerprint at the settings" do
|
144
|
+
@settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint
|
145
|
+
@settings.idp_cert = ruby_saml_cert_text
|
146
|
+
fingerprint = @settings.get_fingerprint
|
147
|
+
assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
45
151
|
end
|
46
152
|
|
47
153
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
2
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "requests/logoutrequest_fixtures"))
|
3
|
+
|
4
|
+
class SloLogoutrequestTest < Minitest::Test
|
5
|
+
|
6
|
+
describe "SloLogoutrequest" do
|
7
|
+
|
8
|
+
describe "#new" do
|
9
|
+
it "raise an exception when request is initialized with nil" do
|
10
|
+
assert_raises(ArgumentError) { OneLogin::RubySaml::SloLogoutrequest.new(nil) }
|
11
|
+
end
|
12
|
+
it "default to empty settings" do
|
13
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request)
|
14
|
+
assert logoutrequest.settings.nil?
|
15
|
+
end
|
16
|
+
it "accept constructor-injected settings" do
|
17
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request, settings)
|
18
|
+
assert !logoutrequest.settings.nil?
|
19
|
+
end
|
20
|
+
it "accept constructor-injected options" do
|
21
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request, nil, { :foo => :bar} )
|
22
|
+
assert !logoutrequest.options.empty?
|
23
|
+
end
|
24
|
+
it "support base64 encoded requests" do
|
25
|
+
expected_request = valid_request
|
26
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(Base64.encode64(expected_request), settings)
|
27
|
+
|
28
|
+
assert_equal expected_request, logoutrequest.request
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#validate" do
|
33
|
+
it "validate the request" do
|
34
|
+
in_relation_to_request_id = random_id
|
35
|
+
settings.idp_entity_id = "https://example.com/idp"
|
36
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request({:uuid => in_relation_to_request_id}), settings)
|
37
|
+
|
38
|
+
assert logoutrequest.validate
|
39
|
+
|
40
|
+
assert_equal settings.idp_entity_id, logoutrequest.issuer
|
41
|
+
|
42
|
+
assert_equal "testuser@example.com", logoutrequest.nameid
|
43
|
+
|
44
|
+
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", logoutrequest.nameid_format
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "#validate!" do
|
50
|
+
it "validates good requests" do
|
51
|
+
in_relation_to_request_id = random_id
|
52
|
+
|
53
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request({:uuid => in_relation_to_request_id}), settings)
|
54
|
+
|
55
|
+
logoutrequest.validate!
|
56
|
+
end
|
57
|
+
|
58
|
+
it "raise error for invalid xml" do
|
59
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(invalid_xml_request, settings)
|
60
|
+
|
61
|
+
assert_raises(OneLogin::RubySaml::ValidationError) { logoutrequest.validate! }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "#request_id" do
|
66
|
+
it "extract the value of the Response ID" do
|
67
|
+
logoutrequest = OneLogin::RubySaml::SloLogoutrequest.new(valid_request, settings)
|
68
|
+
assert_equal "_28024690-000e-0130-b6d2-38f6b112be8b", logoutrequest.request_id
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
@@ -61,6 +61,14 @@ class SloLogoutresponseTest < Minitest::Test
|
|
61
61
|
assert_match /<samlp:StatusMessage>Custom Logout Message<\/samlp:StatusMessage>/, inflated
|
62
62
|
end
|
63
63
|
|
64
|
+
it "set a custom logout message and an status on the response" do
|
65
|
+
unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, nil, "Custom Logout Message", {}, "urn:oasis:names:tc:SAML:2.0:status:PartialLogout")
|
66
|
+
|
67
|
+
inflated = decode_saml_response_payload(unauth_url)
|
68
|
+
assert_match /<samlp:StatusMessage>Custom Logout Message<\/samlp:StatusMessage>/, inflated
|
69
|
+
assert_match /<samlp:StatusCode Value='urn:oasis:names:tc:SAML:2.0:status:PartialLogout/, inflated
|
70
|
+
end
|
71
|
+
|
64
72
|
describe "when the settings indicate to sign (embedded) logout response" do
|
65
73
|
|
66
74
|
before do
|
@@ -222,5 +230,16 @@ class SloLogoutresponseTest < Minitest::Test
|
|
222
230
|
assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string)
|
223
231
|
end
|
224
232
|
end
|
233
|
+
|
234
|
+
describe "#manipulate response_id" do
|
235
|
+
it "be able to modify the response id" do
|
236
|
+
logoutresponse = OneLogin::RubySaml::SloLogoutresponse.new
|
237
|
+
response_id = logoutresponse.response_id
|
238
|
+
assert_equal response_id, logoutresponse.uuid
|
239
|
+
logoutresponse.uuid = "new_uuid"
|
240
|
+
assert_equal logoutresponse.response_id, logoutresponse.uuid
|
241
|
+
assert_equal "new_uuid", logoutresponse.response_id
|
242
|
+
end
|
243
|
+
end
|
225
244
|
end
|
226
245
|
end
|