ruby-saml 1.9.0 → 1.14.0
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 +5 -5
- data/.github/workflows/test.yml +25 -0
- data/{changelog.md → CHANGELOG.md} +64 -1
- data/README.md +394 -211
- data/UPGRADING.md +149 -0
- data/lib/onelogin/ruby-saml/attributes.rb +24 -1
- data/lib/onelogin/ruby-saml/authrequest.rb +26 -10
- data/lib/onelogin/ruby-saml/idp_metadata_parser.rb +285 -184
- data/lib/onelogin/ruby-saml/logging.rb +3 -3
- data/lib/onelogin/ruby-saml/logoutrequest.rb +26 -11
- data/lib/onelogin/ruby-saml/logoutresponse.rb +27 -11
- data/lib/onelogin/ruby-saml/metadata.rb +62 -17
- data/lib/onelogin/ruby-saml/response.rb +86 -37
- data/lib/onelogin/ruby-saml/saml_message.rb +14 -5
- data/lib/onelogin/ruby-saml/setting_error.rb +6 -0
- data/lib/onelogin/ruby-saml/settings.rb +117 -41
- data/lib/onelogin/ruby-saml/slo_logoutrequest.rb +33 -31
- data/lib/onelogin/ruby-saml/slo_logoutresponse.rb +43 -20
- data/lib/onelogin/ruby-saml/utils.rb +101 -9
- data/lib/onelogin/ruby-saml/version.rb +1 -1
- data/lib/xml_security.rb +39 -13
- data/ruby-saml.gemspec +21 -8
- metadata +43 -284
- data/.travis.yml +0 -32
- data/test/certificates/certificate1 +0 -12
- data/test/certificates/certificate_without_head_foot +0 -1
- data/test/certificates/formatted_certificate +0 -14
- data/test/certificates/formatted_chained_certificate +0 -42
- data/test/certificates/formatted_private_key +0 -12
- data/test/certificates/formatted_rsa_private_key +0 -12
- data/test/certificates/invalid_certificate1 +0 -1
- data/test/certificates/invalid_certificate2 +0 -1
- data/test/certificates/invalid_certificate3 +0 -12
- data/test/certificates/invalid_chained_certificate1 +0 -1
- data/test/certificates/invalid_private_key1 +0 -1
- data/test/certificates/invalid_private_key2 +0 -1
- data/test/certificates/invalid_private_key3 +0 -10
- data/test/certificates/invalid_rsa_private_key1 +0 -1
- data/test/certificates/invalid_rsa_private_key2 +0 -1
- data/test/certificates/invalid_rsa_private_key3 +0 -10
- data/test/certificates/ruby-saml-2.crt +0 -15
- data/test/certificates/ruby-saml.crt +0 -14
- data/test/certificates/ruby-saml.key +0 -15
- data/test/idp_metadata_parser_test.rb +0 -579
- data/test/logging_test.rb +0 -62
- data/test/logout_requests/invalid_slo_request.xml +0 -6
- data/test/logout_requests/slo_request.xml +0 -4
- data/test/logout_requests/slo_request.xml.base64 +0 -1
- data/test/logout_requests/slo_request_deflated.xml.base64 +0 -1
- data/test/logout_requests/slo_request_with_name_id_format.xml +0 -4
- data/test/logout_requests/slo_request_with_session_index.xml +0 -5
- data/test/logout_responses/logoutresponse_fixtures.rb +0 -67
- data/test/logoutrequest_test.rb +0 -226
- data/test/logoutresponse_test.rb +0 -402
- data/test/metadata/idp_descriptor.xml +0 -26
- data/test/metadata/idp_descriptor_2.xml +0 -56
- data/test/metadata/idp_descriptor_3.xml +0 -14
- data/test/metadata/idp_descriptor_4.xml +0 -72
- data/test/metadata/idp_metadata_different_sign_and_encrypt_cert.xml +0 -72
- data/test/metadata/idp_metadata_multi_certs.xml +0 -75
- data/test/metadata/idp_metadata_multi_signing_certs.xml +0 -52
- data/test/metadata/idp_metadata_same_sign_and_encrypt_cert.xml +0 -71
- data/test/metadata/idp_multiple_descriptors.xml +0 -53
- data/test/metadata/no_idp_descriptor.xml +0 -21
- data/test/metadata_test.rb +0 -331
- data/test/request_test.rb +0 -323
- data/test/response_test.rb +0 -1619
- data/test/responses/adfs_response_sha1.xml +0 -46
- data/test/responses/adfs_response_sha256.xml +0 -46
- data/test/responses/adfs_response_sha384.xml +0 -46
- data/test/responses/adfs_response_sha512.xml +0 -46
- data/test/responses/adfs_response_xmlns.xml +0 -45
- data/test/responses/attackxee.xml +0 -13
- data/test/responses/invalids/duplicated_attributes.xml.base64 +0 -1
- data/test/responses/invalids/empty_destination.xml.base64 +0 -1
- data/test/responses/invalids/empty_nameid.xml.base64 +0 -1
- data/test/responses/invalids/encrypted_new_attack.xml.base64 +0 -1
- data/test/responses/invalids/invalid_audience.xml.base64 +0 -1
- data/test/responses/invalids/invalid_issuer_assertion.xml.base64 +0 -1
- data/test/responses/invalids/invalid_issuer_message.xml.base64 +0 -1
- data/test/responses/invalids/invalid_signature_position.xml.base64 +0 -1
- data/test/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 +0 -1
- data/test/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 +0 -1
- data/test/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 +0 -1
- data/test/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 +0 -1
- data/test/responses/invalids/multiple_assertions.xml.base64 +0 -2
- data/test/responses/invalids/multiple_signed.xml.base64 +0 -1
- data/test/responses/invalids/no_authnstatement.xml.base64 +0 -1
- data/test/responses/invalids/no_conditions.xml.base64 +0 -1
- data/test/responses/invalids/no_id.xml.base64 +0 -1
- data/test/responses/invalids/no_issuer_assertion.xml.base64 +0 -1
- data/test/responses/invalids/no_issuer_response.xml.base64 +0 -1
- data/test/responses/invalids/no_nameid.xml.base64 +0 -1
- data/test/responses/invalids/no_saml2.xml.base64 +0 -1
- data/test/responses/invalids/no_signature.xml.base64 +0 -1
- data/test/responses/invalids/no_status.xml.base64 +0 -1
- data/test/responses/invalids/no_status_code.xml.base64 +0 -1
- data/test/responses/invalids/no_subjectconfirmation_data.xml.base64 +0 -1
- data/test/responses/invalids/no_subjectconfirmation_method.xml.base64 +0 -1
- data/test/responses/invalids/response_invalid_signed_element.xml.base64 +0 -1
- data/test/responses/invalids/response_with_concealed_signed_assertion.xml +0 -51
- data/test/responses/invalids/response_with_doubled_signed_assertion.xml +0 -49
- data/test/responses/invalids/signature_wrapping_attack.xml.base64 +0 -1
- data/test/responses/invalids/status_code_responder.xml.base64 +0 -1
- data/test/responses/invalids/status_code_responer_and_msg.xml.base64 +0 -1
- data/test/responses/invalids/wrong_spnamequalifier.xml.base64 +0 -1
- data/test/responses/no_signature_ns.xml +0 -48
- data/test/responses/open_saml_response.xml +0 -56
- data/test/responses/response_assertion_wrapped.xml.base64 +0 -93
- data/test/responses/response_audience_self_closed_tag.xml.base64 +0 -1
- data/test/responses/response_double_status_code.xml.base64 +0 -1
- data/test/responses/response_encrypted_attrs.xml.base64 +0 -1
- data/test/responses/response_encrypted_nameid.xml.base64 +0 -1
- data/test/responses/response_eval.xml +0 -7
- data/test/responses/response_no_cert_and_encrypted_attrs.xml +0 -29
- data/test/responses/response_node_text_attack.xml.base64 +0 -1
- data/test/responses/response_node_text_attack2.xml.base64 +0 -1
- data/test/responses/response_node_text_attack3.xml.base64 +0 -1
- data/test/responses/response_unsigned_xml_base64 +0 -1
- data/test/responses/response_with_ampersands.xml +0 -139
- data/test/responses/response_with_ampersands.xml.base64 +0 -93
- data/test/responses/response_with_ds_namespace_at_the_root.xml.base64 +0 -1
- data/test/responses/response_with_multiple_attribute_statements.xml +0 -72
- data/test/responses/response_with_multiple_attribute_values.xml +0 -67
- data/test/responses/response_with_retrieval_method.xml +0 -26
- data/test/responses/response_with_saml2_namespace.xml.base64 +0 -102
- data/test/responses/response_with_signed_assertion.xml.base64 +0 -66
- data/test/responses/response_with_signed_assertion_2.xml.base64 +0 -1
- data/test/responses/response_with_signed_assertion_3.xml +0 -30
- data/test/responses/response_with_signed_message_and_assertion.xml +0 -34
- data/test/responses/response_with_undefined_recipient.xml.base64 +0 -1
- data/test/responses/response_without_attributes.xml.base64 +0 -79
- data/test/responses/response_without_reference_uri.xml.base64 +0 -1
- data/test/responses/response_wrapped.xml.base64 +0 -150
- data/test/responses/signed_message_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/signed_message_encrypted_unsigned_assertion.xml.base64 +0 -1
- data/test/responses/signed_nameid_in_atts.xml +0 -47
- data/test/responses/signed_unqual_nameid_in_atts.xml +0 -47
- data/test/responses/simple_saml_php.xml +0 -71
- data/test/responses/starfield_response.xml.base64 +0 -1
- data/test/responses/test_sign.xml +0 -43
- data/test/responses/unsigned_encrypted_adfs.xml +0 -23
- data/test/responses/unsigned_message_aes128_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/unsigned_message_aes192_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/unsigned_message_aes256_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/unsigned_message_des192_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/unsigned_message_encrypted_assertion_without_saml_namespace.xml.base64 +0 -1
- data/test/responses/unsigned_message_encrypted_signed_assertion.xml.base64 +0 -1
- data/test/responses/unsigned_message_encrypted_unsigned_assertion.xml.base64 +0 -1
- data/test/responses/valid_response.xml.base64 +0 -1
- data/test/responses/valid_response_with_formatted_x509certificate.xml.base64 +0 -1
- data/test/responses/valid_response_without_x509certificate.xml.base64 +0 -1
- data/test/saml_message_test.rb +0 -56
- data/test/settings_test.rb +0 -329
- data/test/slo_logoutrequest_test.rb +0 -448
- data/test/slo_logoutresponse_test.rb +0 -199
- data/test/test_helper.rb +0 -327
- data/test/utils_test.rb +0 -254
- data/test/xml_security_test.rb +0 -421
@@ -1,15 +0,0 @@
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
2
|
-
MIICXAIBAAKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCH
|
3
|
-
k8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G1
|
4
|
-
4jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQAB
|
5
|
-
AoGBALGR6bRBit+yV5TUU3MZSrf8WQSLWDLgs/33FQSAEYSib4+DJke2lKbI6jkG
|
6
|
-
UoSJgFUXFbaQLtMY2+3VDsMKPBdAge9gIdvbkC4yoKjLGm/FBDOxxZcfLpR+9OPq
|
7
|
-
U3qM9D0CNuliBWI7Je+p/zs09HIYucpDXy9E18KA1KNF6rfhAkEA9KoNam6wAKnm
|
8
|
-
vMzz31ws3RuIOUeo2rx6aaVY95+P9tTxd6U+pNkwxy1aCGP+InVSwlYNA1aQ4Axi
|
9
|
-
/GdMIWMkxwJBAPO1CP7cQNZQmu7yusY+GUObDII5YK9WLaY4RAicn5378crPBFxv
|
10
|
-
Ukqf9G6FHo7u88iTCIp+vwa3Hn9Tumg3iP0CQQDgUXWBasCVqzCxU5wY4tMDWjXY
|
11
|
-
hpoLCpmVeRML3dDJt004rFm2HKe7Rhpw7PTZNQZOxUSjFeA4e0LaNf838UWLAkB8
|
12
|
-
QfbHM3ffjhOg96PhhjINdVWoZCb230LBOHj/xxPfUmFTHcBEfQIBSJMxcrBFAnLL
|
13
|
-
9qPpMXymqOFk3ETz9DTlAj8E0qGbp78aVbTOtuwEwNJII+RPw+Zkc+lKR+yaWkAz
|
14
|
-
fIXw527NPHH3+rnBG72wyZr9ud4LAum9jh+5No1LQpk=
|
15
|
-
-----END RSA PRIVATE KEY-----
|
@@ -1,579 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
2
|
-
|
3
|
-
require 'onelogin/ruby-saml/idp_metadata_parser'
|
4
|
-
|
5
|
-
class IdpMetadataParserTest < Minitest::Test
|
6
|
-
class MockSuccessResponse < Net::HTTPSuccess
|
7
|
-
# override parent's initialize
|
8
|
-
def initialize; end
|
9
|
-
|
10
|
-
attr_accessor :body
|
11
|
-
end
|
12
|
-
|
13
|
-
class MockFailureResponse < Net::HTTPNotFound
|
14
|
-
# override parent's initialize
|
15
|
-
def initialize; end
|
16
|
-
|
17
|
-
attr_accessor :body
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "parsing an IdP descriptor file" do
|
21
|
-
it "extract settings details from xml" do
|
22
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
23
|
-
|
24
|
-
settings = idp_metadata_parser.parse(idp_metadata_descriptor)
|
25
|
-
|
26
|
-
assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id
|
27
|
-
assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_target_url
|
28
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
29
|
-
assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_target_url
|
30
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format
|
31
|
-
assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names
|
32
|
-
end
|
33
|
-
|
34
|
-
it "extract certificate from md:KeyDescriptor[@use='signing']" do
|
35
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
36
|
-
idp_metadata = idp_metadata_descriptor
|
37
|
-
settings = idp_metadata_parser.parse(idp_metadata)
|
38
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
39
|
-
end
|
40
|
-
|
41
|
-
it "extract certificate from md:KeyDescriptor[@use='encryption']" do
|
42
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
43
|
-
idp_metadata = idp_metadata_descriptor
|
44
|
-
idp_metadata = idp_metadata.sub(/<md:KeyDescriptor use="signing">(.*?)<\/md:KeyDescriptor>/m, "")
|
45
|
-
settings = idp_metadata_parser.parse(idp_metadata)
|
46
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
47
|
-
end
|
48
|
-
|
49
|
-
it "extract certificate from md:KeyDescriptor" do
|
50
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
51
|
-
idp_metadata = idp_metadata_descriptor
|
52
|
-
idp_metadata = idp_metadata.sub(/<md:KeyDescriptor use="signing">(.*?)<\/md:KeyDescriptor>/m, "")
|
53
|
-
idp_metadata = idp_metadata.sub('<md:KeyDescriptor use="encryption">', '<md:KeyDescriptor>')
|
54
|
-
settings = idp_metadata_parser.parse(idp_metadata)
|
55
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
56
|
-
end
|
57
|
-
|
58
|
-
it "extract SSO endpoint with no specific binding, it takes the first" do
|
59
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
60
|
-
idp_metadata = idp_metadata_descriptor3
|
61
|
-
settings = idp_metadata_parser.parse(idp_metadata)
|
62
|
-
assert_equal "https://idp.example.com/idp/profile/Shibboleth/SSO", settings.idp_sso_target_url
|
63
|
-
end
|
64
|
-
|
65
|
-
it "extract SSO endpoint with specific binding" do
|
66
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
67
|
-
idp_metadata = idp_metadata_descriptor3
|
68
|
-
options = {}
|
69
|
-
options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST']
|
70
|
-
settings = idp_metadata_parser.parse(idp_metadata, options)
|
71
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/POST/SSO", settings.idp_sso_target_url
|
72
|
-
|
73
|
-
options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
|
74
|
-
settings = idp_metadata_parser.parse(idp_metadata, options)
|
75
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", settings.idp_sso_target_url
|
76
|
-
|
77
|
-
options[:sso_binding] = ['invalid_binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
|
78
|
-
settings = idp_metadata_parser.parse(idp_metadata, options)
|
79
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", settings.idp_sso_target_url
|
80
|
-
end
|
81
|
-
|
82
|
-
it "uses settings options as hash for overrides" do
|
83
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
84
|
-
idp_metadata = idp_metadata_descriptor
|
85
|
-
settings = idp_metadata_parser.parse(idp_metadata, {
|
86
|
-
:settings => {
|
87
|
-
:security => {
|
88
|
-
:digest_method => XMLSecurity::Document::SHA256,
|
89
|
-
:signature_method => XMLSecurity::Document::RSA_SHA256
|
90
|
-
}
|
91
|
-
}
|
92
|
-
})
|
93
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
94
|
-
assert_equal XMLSecurity::Document::SHA256, settings.security[:digest_method]
|
95
|
-
assert_equal XMLSecurity::Document::RSA_SHA256, settings.security[:signature_method]
|
96
|
-
end
|
97
|
-
|
98
|
-
it "merges results into given settings object" do
|
99
|
-
settings = OneLogin::RubySaml::Settings.new(:security => {
|
100
|
-
:digest_method => XMLSecurity::Document::SHA256,
|
101
|
-
:signature_method => XMLSecurity::Document::RSA_SHA256
|
102
|
-
})
|
103
|
-
|
104
|
-
OneLogin::RubySaml::IdpMetadataParser.new.parse(idp_metadata_descriptor, :settings => settings)
|
105
|
-
|
106
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
107
|
-
assert_equal XMLSecurity::Document::SHA256, settings.security[:digest_method]
|
108
|
-
assert_equal XMLSecurity::Document::RSA_SHA256, settings.security[:signature_method]
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
describe "parsing an IdP descriptor file into an Hash" do
|
113
|
-
it "extract settings details from xml" do
|
114
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
115
|
-
|
116
|
-
metadata = idp_metadata_parser.parse_to_hash(idp_metadata_descriptor)
|
117
|
-
|
118
|
-
assert_equal "https://hello.example.com/access/saml/idp.xml", metadata[:idp_entity_id]
|
119
|
-
assert_equal "https://hello.example.com/access/saml/login", metadata[:idp_sso_target_url]
|
120
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata[:idp_cert_fingerprint]
|
121
|
-
assert_equal "https://hello.example.com/access/saml/logout", metadata[:idp_slo_target_url]
|
122
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", metadata[:name_identifier_format]
|
123
|
-
assert_equal ["AuthToken", "SSOStartPage"], metadata[:idp_attribute_names]
|
124
|
-
end
|
125
|
-
|
126
|
-
it "extract certificate from md:KeyDescriptor[@use='signing']" do
|
127
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
128
|
-
idp_metadata = idp_metadata_descriptor
|
129
|
-
metadata = idp_metadata_parser.parse_to_hash(idp_metadata)
|
130
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata[:idp_cert_fingerprint]
|
131
|
-
end
|
132
|
-
|
133
|
-
it "extract certificate from md:KeyDescriptor[@use='encryption']" do
|
134
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
135
|
-
idp_metadata = idp_metadata_descriptor
|
136
|
-
idp_metadata = idp_metadata.sub(/<md:KeyDescriptor use="signing">(.*?)<\/md:KeyDescriptor>/m, "")
|
137
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata)
|
138
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint]
|
139
|
-
end
|
140
|
-
|
141
|
-
it "extract certificate from md:KeyDescriptor" do
|
142
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
143
|
-
idp_metadata = idp_metadata_descriptor
|
144
|
-
idp_metadata = idp_metadata.sub(/<md:KeyDescriptor use="signing">(.*?)<\/md:KeyDescriptor>/m, "")
|
145
|
-
idp_metadata = idp_metadata.sub('<md:KeyDescriptor use="encryption">', '<md:KeyDescriptor>')
|
146
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata)
|
147
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint]
|
148
|
-
end
|
149
|
-
|
150
|
-
it "extract SSO endpoint with no specific binding, it takes the first" do
|
151
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
152
|
-
idp_metadata = idp_metadata_descriptor3
|
153
|
-
metadata = idp_metadata_parser.parse_to_hash(idp_metadata)
|
154
|
-
assert_equal "https://idp.example.com/idp/profile/Shibboleth/SSO", metadata[:idp_sso_target_url]
|
155
|
-
end
|
156
|
-
|
157
|
-
it "extract SSO endpoint with specific binding" do
|
158
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
159
|
-
idp_metadata = idp_metadata_descriptor3
|
160
|
-
options = {}
|
161
|
-
options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST']
|
162
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options)
|
163
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/POST/SSO", parsed_metadata[:idp_sso_target_url]
|
164
|
-
|
165
|
-
options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
|
166
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options)
|
167
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", parsed_metadata[:idp_sso_target_url]
|
168
|
-
|
169
|
-
options[:sso_binding] = ['invalid_binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
|
170
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options)
|
171
|
-
assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", parsed_metadata[:idp_sso_target_url]
|
172
|
-
end
|
173
|
-
|
174
|
-
it "ignores a given :settings hash" do
|
175
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
176
|
-
idp_metadata = idp_metadata_descriptor
|
177
|
-
parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, {
|
178
|
-
:settings => {
|
179
|
-
:security => {
|
180
|
-
:digest_method => XMLSecurity::Document::SHA256,
|
181
|
-
:signature_method => XMLSecurity::Document::RSA_SHA256
|
182
|
-
}
|
183
|
-
}
|
184
|
-
})
|
185
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint]
|
186
|
-
assert_nil parsed_metadata[:security]
|
187
|
-
end
|
188
|
-
|
189
|
-
it "can extract certificates multiple times in sequence" do
|
190
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
191
|
-
idp_metadata1 = idp_metadata_descriptor
|
192
|
-
idp_metadata2 = idp_metadata_descriptor4
|
193
|
-
metadata1 = idp_metadata_parser.parse_to_hash(idp_metadata1)
|
194
|
-
metadata2 = idp_metadata_parser.parse_to_hash(idp_metadata2)
|
195
|
-
|
196
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata1[:idp_cert_fingerprint]
|
197
|
-
assert_equal "CD:2B:2B:DA:FF:F5:DB:64:10:7C:AC:FD:FE:0F:CB:5D:73:5F:16:07", metadata2[:idp_cert_fingerprint]
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
describe "parsing an IdP descriptor file with multiple signing certs" do
|
202
|
-
it "extract settings details from xml" do
|
203
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
204
|
-
|
205
|
-
settings = idp_metadata_parser.parse(idp_metadata_descriptor2)
|
206
|
-
|
207
|
-
assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id
|
208
|
-
assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_target_url
|
209
|
-
assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_target_url
|
210
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format
|
211
|
-
assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names
|
212
|
-
|
213
|
-
assert_nil settings.idp_cert_fingerprint
|
214
|
-
assert_nil settings.idp_cert
|
215
|
-
assert_equal 2, settings.idp_cert_multi.size
|
216
|
-
assert settings.idp_cert_multi.key?(:signing)
|
217
|
-
assert_equal 2, settings.idp_cert_multi[:signing].size
|
218
|
-
assert settings.idp_cert_multi.key?(:encryption)
|
219
|
-
assert_equal 1, settings.idp_cert_multi[:encryption].size
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
describe "download and parse IdP descriptor file" do
|
224
|
-
before do
|
225
|
-
mock_response = MockSuccessResponse.new
|
226
|
-
mock_response.body = idp_metadata_descriptor
|
227
|
-
@url = "https://example.com"
|
228
|
-
uri = URI(@url)
|
229
|
-
|
230
|
-
@http = Net::HTTP.new(uri.host, uri.port)
|
231
|
-
Net::HTTP.expects(:new).returns(@http)
|
232
|
-
@http.expects(:request).returns(mock_response)
|
233
|
-
end
|
234
|
-
|
235
|
-
it "extract settings from remote xml" do
|
236
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
237
|
-
settings = idp_metadata_parser.parse_remote(@url)
|
238
|
-
|
239
|
-
assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id
|
240
|
-
assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_target_url
|
241
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint
|
242
|
-
assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_target_url
|
243
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format
|
244
|
-
assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names
|
245
|
-
assert_equal OpenSSL::SSL::VERIFY_PEER, @http.verify_mode
|
246
|
-
end
|
247
|
-
|
248
|
-
it "accept self signed certificate if insturcted" do
|
249
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
250
|
-
idp_metadata_parser.parse_remote(@url, false)
|
251
|
-
|
252
|
-
assert_equal OpenSSL::SSL::VERIFY_NONE, @http.verify_mode
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
describe "download and parse IdP descriptor file into an Hash" do
|
257
|
-
before do
|
258
|
-
mock_response = MockSuccessResponse.new
|
259
|
-
mock_response.body = idp_metadata_descriptor
|
260
|
-
@url = "https://example.com"
|
261
|
-
uri = URI(@url)
|
262
|
-
|
263
|
-
@http = Net::HTTP.new(uri.host, uri.port)
|
264
|
-
Net::HTTP.expects(:new).returns(@http)
|
265
|
-
@http.expects(:request).returns(mock_response)
|
266
|
-
end
|
267
|
-
|
268
|
-
it "extract settings from remote xml" do
|
269
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
270
|
-
parsed_metadata = idp_metadata_parser.parse_remote_to_hash(@url)
|
271
|
-
|
272
|
-
assert_equal "https://hello.example.com/access/saml/idp.xml", parsed_metadata[:idp_entity_id]
|
273
|
-
assert_equal "https://hello.example.com/access/saml/login", parsed_metadata[:idp_sso_target_url]
|
274
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint]
|
275
|
-
assert_equal "https://hello.example.com/access/saml/logout", parsed_metadata[:idp_slo_target_url]
|
276
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", parsed_metadata[:name_identifier_format]
|
277
|
-
assert_equal ["AuthToken", "SSOStartPage"], parsed_metadata[:idp_attribute_names]
|
278
|
-
assert_equal OpenSSL::SSL::VERIFY_PEER, @http.verify_mode
|
279
|
-
end
|
280
|
-
|
281
|
-
it "accept self signed certificate if insturcted" do
|
282
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
283
|
-
idp_metadata_parser.parse_remote_to_hash(@url, false)
|
284
|
-
|
285
|
-
assert_equal OpenSSL::SSL::VERIFY_NONE, @http.verify_mode
|
286
|
-
end
|
287
|
-
end
|
288
|
-
|
289
|
-
describe "download failure cases" do
|
290
|
-
it "raises an exception when the url has no scheme" do
|
291
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
292
|
-
|
293
|
-
exception = assert_raises(ArgumentError) do
|
294
|
-
idp_metadata_parser.parse_remote("blahblah")
|
295
|
-
end
|
296
|
-
|
297
|
-
assert_equal("url must begin with http or https", exception.message)
|
298
|
-
end
|
299
|
-
|
300
|
-
it "raises an exception when unable to download metadata" do
|
301
|
-
mock_response = MockFailureResponse.new
|
302
|
-
@url = "https://example.com"
|
303
|
-
uri = URI(@url)
|
304
|
-
|
305
|
-
@http = Net::HTTP.new(uri.host, uri.port)
|
306
|
-
Net::HTTP.expects(:new).returns(@http)
|
307
|
-
@http.expects(:request).returns(mock_response)
|
308
|
-
|
309
|
-
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
310
|
-
|
311
|
-
exception = assert_raises(OneLogin::RubySaml::HttpError) do
|
312
|
-
idp_metadata_parser.parse_remote("https://hello.example.com/access/saml/idp.xml")
|
313
|
-
end
|
314
|
-
|
315
|
-
assert_match("Failed to fetch idp metadata", exception.message)
|
316
|
-
end
|
317
|
-
end
|
318
|
-
|
319
|
-
describe "parsing metadata with many entity descriptors" do
|
320
|
-
before do
|
321
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
322
|
-
@idp_metadata = idp_metadata_multiple_descriptors
|
323
|
-
@settings = @idp_metadata_parser.parse(@idp_metadata)
|
324
|
-
end
|
325
|
-
|
326
|
-
it "should find first descriptor" do
|
327
|
-
assert_equal "https://foo.example.com/access/saml/idp.xml", @settings.idp_entity_id
|
328
|
-
end
|
329
|
-
|
330
|
-
it "should find named descriptor" do
|
331
|
-
entity_id = "https://bar.example.com/access/saml/idp.xml"
|
332
|
-
settings = @idp_metadata_parser.parse(
|
333
|
-
@idp_metadata, :entity_id => entity_id
|
334
|
-
)
|
335
|
-
assert_equal entity_id, settings.idp_entity_id
|
336
|
-
end
|
337
|
-
|
338
|
-
it "should retreive data" do
|
339
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", @settings.name_identifier_format
|
340
|
-
assert_equal "https://hello.example.com/access/saml/login", @settings.idp_sso_target_url
|
341
|
-
assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", @settings.idp_cert_fingerprint
|
342
|
-
assert_equal "https://hello.example.com/access/saml/logout", @settings.idp_slo_target_url
|
343
|
-
assert_equal ["AuthToken", "SSOStartPage"], @settings.idp_attribute_names
|
344
|
-
end
|
345
|
-
end
|
346
|
-
|
347
|
-
describe "parsing metadata with no IDPSSODescriptor element" do
|
348
|
-
before do
|
349
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
350
|
-
@idp_metadata = no_idp_metadata_descriptor
|
351
|
-
end
|
352
|
-
|
353
|
-
it "raise due no IDPSSODescriptor element" do
|
354
|
-
assert_raises(ArgumentError) { @idp_metadata_parser.parse(@idp_metadata) }
|
355
|
-
end
|
356
|
-
end
|
357
|
-
|
358
|
-
describe "parsing metadata with IDPSSODescriptor with multiple certs" do
|
359
|
-
before do
|
360
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
361
|
-
@idp_metadata = idp_metadata_multiple_certs
|
362
|
-
@settings = @idp_metadata_parser.parse(@idp_metadata)
|
363
|
-
end
|
364
|
-
|
365
|
-
it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do
|
366
|
-
assert_nil @settings.idp_cert
|
367
|
-
assert_nil @settings.idp_cert_fingerprint
|
368
|
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gztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ
|
417
|
-
WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw=="]
|
418
|
-
|
419
|
-
assert_equal expected_multi_cert, @settings.idp_cert_multi
|
420
|
-
assert_equal "https://idp.examle.com/saml/metadata", @settings.idp_entity_id
|
421
|
-
assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", @settings.name_identifier_format
|
422
|
-
assert_equal "https://idp.examle.com/saml/sso", @settings.idp_sso_target_url
|
423
|
-
assert_equal "https://idp.examle.com/saml/slo", @settings.idp_slo_target_url
|
424
|
-
end
|
425
|
-
end
|
426
|
-
|
427
|
-
describe "parsing metadata with IDPSSODescriptor with multiple signing certs" do
|
428
|
-
before do
|
429
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
430
|
-
@idp_metadata = idp_metadata_multiple_signing_certs
|
431
|
-
@settings = @idp_metadata_parser.parse(@idp_metadata)
|
432
|
-
end
|
433
|
-
|
434
|
-
it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do
|
435
|
-
assert_nil @settings.idp_cert
|
436
|
-
assert_nil @settings.idp_cert_fingerprint
|
437
|
-
|
438
|
-
expected_multi_cert = {}
|
439
|
-
expected_multi_cert[:signing] = ["MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF
|
440
|
-
BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj
|
441
|
-
aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW
|
442
|
-
T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy
|
443
|
-
MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz
|
444
|
-
Z2FyY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Z1FXQkJTUk9OOEdKOG8rOGpnRnRqa3R3WmRxeDZCUnlUQVRCZ05WSFNVRUREQUtCZ2dyCkJnRUZCUWNEQVRBZEJnbGdoa2dCaHZoQ0FRMEVFQllPVkdWemRDQllOVEE1SUdObGNuUXdnYk1HQTFVZEl3U0IKcXpDQnFJQVVrVGpmQmlmS1B2STRCYlk1TGNHWGFzZWdVY21oZ1l5a2dZa3dnWVl4Q3pBSkJnTlZCQVlUQWtGVgpNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVEJsTjVaRzVsZVRFTU1Bb0dBMVVFQ2d3RFVFbFVNUWt3CkJ3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="]
|
463
|
-
|
464
|
-
assert_equal expected_multi_cert, @settings.idp_cert_multi
|
465
|
-
assert_equal "https://idp.examle.com/saml/metadata", @settings.idp_entity_id
|
466
|
-
assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", @settings.name_identifier_format
|
467
|
-
assert_equal "https://idp.examle.com/saml/sso", @settings.idp_sso_target_url
|
468
|
-
assert_equal "https://idp.examle.com/saml/slo", @settings.idp_slo_target_url
|
469
|
-
end
|
470
|
-
end
|
471
|
-
|
472
|
-
describe "parsing metadata with IDPSSODescriptor with same signature cert and encrypt cert" do
|
473
|
-
before do
|
474
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
475
|
-
@idp_metadata = idp_metadata_same_sign_and_encrypt_cert
|
476
|
-
@settings = @idp_metadata_parser.parse(@idp_metadata)
|
477
|
-
end
|
478
|
-
|
479
|
-
it "should return idp_cert and idp_cert_fingerprint and no idp_cert_multi" do
|
480
|
-
assert_equal "MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET
|
481
|
-
MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD
|
482
|
-
VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2
|
483
|
-
MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI
|
484
|
-
DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u
|
485
|
-
ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B
|
486
|
-
AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z
|
487
|
-
0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT
|
488
|
-
gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuIPy4vVP06Dt8EMkQIr8rmLmU0m
|
489
|
-
Tr1k2DkrdtdlCuNFTXuAu3QqfvNCRrRwfNObn9MP6JeOUdcGLJsBjGF8exfcN1SF
|
490
|
-
zRF0JFr3dmOlx761zK5liD0T1sYWnDquatj/JD9fZMbKecBKni1NglH/LVd+b6aJ
|
491
|
-
UAr5LulERULUjLqYJRKW31u91/4Qazdo9tbvwqyFxaoUrwIDAQABo4HUMIHRMAwG
|
492
|
-
A1UdEwEB/wQCMAAwHQYDVR0OBBYEFPWcXvQSlTXnzZD2xziuoUvrrDedMIGRBgNV
|
493
|
-
HSMEgYkwgYaAFPWcXvQSlTXnzZD2xziuoUvrrDedoWukaTBnMQswCQYDVQQGEwJV
|
494
|
-
UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREw
|
495
|
-
DwYDVQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbYIBATAO
|
496
|
-
BgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADggEBAB/8xe3rzqXQVxzHyAHu
|
497
|
-
AuPa73ClDoL1cko0Fp8CGcqEIyj6Te9gx5z6wyfv+Lo8RFvBLlnB1lXqbC+fTGcV
|
498
|
-
gG/4oKLJ5UwRFxInqpZPnOAudVNnd0PYOODn9FWs6u+OTIQIaIcPUv3MhB9lwHIJ
|
499
|
-
sTk/bs9xcru5TPyLIxLLd6ib/pRceKH2mTkzUd0DYk9CQNXXeoGx/du5B9nh3ClP
|
500
|
-
TbVakRzl3oswgI5MQIphYxkW70SopEh4kOFSRE1ND31NNIq1YrXlgtkguQBFsZWu
|
501
|
-
QOPR6cEwFZzP0tHTYbI839WgxX6hfhIUTUz6mLqq4+3P4BG3+1OXeVDg63y8Uh78
|
502
|
-
1sE=", @settings.idp_cert
|
503
|
-
assert_equal "2D:A9:40:88:28:EE:67:BB:4A:5B:E0:58:A7:CC:71:95:2D:1B:C9:D3", @settings.idp_cert_fingerprint
|
504
|
-
assert_nil @settings.idp_cert_multi
|
505
|
-
assert_equal "https://app.onelogin.com/saml/metadata/383123", @settings.idp_entity_id
|
506
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @settings.name_identifier_format
|
507
|
-
assert_equal "https://app.onelogin.com/trust/saml2/http-post/sso/383123", @settings.idp_sso_target_url
|
508
|
-
assert_nil @settings.idp_slo_target_url
|
509
|
-
end
|
510
|
-
end
|
511
|
-
|
512
|
-
describe "parsing metadata with IDPSSODescriptor with different signature cert and encrypt cert" do
|
513
|
-
before do
|
514
|
-
@idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
515
|
-
@idp_metadata = idp_metadata_different_sign_and_encrypt_cert
|
516
|
-
@settings = @idp_metadata_parser.parse(@idp_metadata)
|
517
|
-
end
|
518
|
-
|
519
|
-
it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do
|
520
|
-
assert_nil @settings.idp_cert
|
521
|
-
assert_nil @settings.idp_cert_fingerprint
|
522
|
-
|
523
|
-
expected_multi_cert = {}
|
524
|
-
expected_multi_cert[:signing] = ["MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET
|
525
|
-
MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD
|
526
|
-
VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2
|
527
|
-
MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI
|
528
|
-
DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u
|
529
|
-
ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B
|
530
|
-
AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z
|
531
|
-
0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT
|
532
|
-
gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuI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biBUZXN0IChzZ2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQL
|
563
|
-
DAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDaC
|
564
|
-
FD8svwN22QGeJtvD8xFFKE+0SYcSMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0B
|
565
|
-
AQUFAAOCAQEAQhB4q9jrycwbHrDSoYR1X4LFFzvJ9Us75wQquRHXpdyS9D6HUBXM
|
566
|
-
GI6ahPicXCQrfLgN8vzMIiqZqfySXXv/8/dxe/X4UsWLYKYJHDJmxXD5EmWTa65c
|
567
|
-
hjkeP1oJAc8f3CKCpcP2lOBTthbnk2fEVAeLHR4xNdQO0VvGXWO9BliYPpkYqUIB
|
568
|
-
vlm+Fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37
|
569
|
-
MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ
|
570
|
-
WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw=="]
|
571
|
-
|
572
|
-
assert_equal expected_multi_cert, @settings.idp_cert_multi
|
573
|
-
assert_equal "https://app.onelogin.com/saml/metadata/383123", @settings.idp_entity_id
|
574
|
-
assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @settings.name_identifier_format
|
575
|
-
assert_equal "https://app.onelogin.com/trust/saml2/http-post/sso/383123", @settings.idp_sso_target_url
|
576
|
-
assert_nil @settings.idp_slo_target_url
|
577
|
-
end
|
578
|
-
end
|
579
|
-
end
|
data/test/logging_test.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
2
|
-
|
3
|
-
require 'onelogin/ruby-saml/logging'
|
4
|
-
|
5
|
-
class LoggingTest < Minitest::Test
|
6
|
-
|
7
|
-
describe "Logging" do
|
8
|
-
before do
|
9
|
-
OneLogin::RubySaml::Logging.logger = nil
|
10
|
-
end
|
11
|
-
|
12
|
-
after do
|
13
|
-
OneLogin::RubySaml::Logging.logger = ::TEST_LOGGER
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "given no specific logging setup" do
|
17
|
-
it "prints to stdout" do
|
18
|
-
OneLogin::RubySaml::Logging::DEFAULT_LOGGER.expects(:debug).with('hi mom')
|
19
|
-
OneLogin::RubySaml::Logging.debug('hi mom')
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "given a Rails app" do
|
24
|
-
let(:logger) { mock('Logger') }
|
25
|
-
|
26
|
-
before do
|
27
|
-
::Rails = mock('Rails module')
|
28
|
-
::Rails.stubs(:logger).returns(logger)
|
29
|
-
end
|
30
|
-
|
31
|
-
after do
|
32
|
-
Object.instance_eval { remove_const(:Rails) }
|
33
|
-
end
|
34
|
-
|
35
|
-
it "delegates to Rails" do
|
36
|
-
logger.expects(:debug).with('hi mom')
|
37
|
-
logger.expects(:info).with('sup?')
|
38
|
-
|
39
|
-
OneLogin::RubySaml::Logging.debug('hi mom')
|
40
|
-
OneLogin::RubySaml::Logging.info('sup?')
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "given a specific Logger" do
|
45
|
-
let(:logger) { mock('Logger') }
|
46
|
-
|
47
|
-
before { OneLogin::RubySaml::Logging.logger = logger }
|
48
|
-
|
49
|
-
after do
|
50
|
-
OneLogin::RubySaml::Logging.logger = ::TEST_LOGGER
|
51
|
-
end
|
52
|
-
|
53
|
-
it "delegates to the object" do
|
54
|
-
logger.expects(:debug).with('hi mom')
|
55
|
-
logger.expects(:info).with('sup?')
|
56
|
-
|
57
|
-
OneLogin::RubySaml::Logging.debug('hi mom')
|
58
|
-
OneLogin::RubySaml::Logging.info('sup?')
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<samlp:LogoutRequest Version='2.0' ID='_c0348950-935b-0131-1060-782bcb56fcaa' xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol' IssueInstant='2014-03-21T19:20:13'>
|
2
|
-
<saml:Issuer xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>https://app.onelogin.com/saml/metadata/SOMEACCOUNT</saml:Issuer>
|
3
|
-
<saml:Issuer xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>https://app.onelogin.com/saml/metadata/SOMEACCOUNT</saml:Issuer>
|
4
|
-
<saml:NameID xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>someone@example.org</saml:NameID>
|
5
|
-
<saml:NameID xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>someone2@example.org</saml:NameID>
|
6
|
-
</samlp:LogoutRequest>
|