File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,5 +388,29 @@ class XmlSecurityTest < Minitest::Test
388388 end
389389 end
390390 end
391+
392+ describe '#validate_document_with_cert' do
393+ describe 'with valid document ' do
394+ describe 'when response has cert' do
395+ let ( :document_data ) { read_response ( 'response_with_signed_message_and_assertion.xml' ) }
396+ let ( :document ) { OneLogin ::RubySaml ::Response . new ( document_data ) . document }
397+ let ( :idp_cert ) { OpenSSL ::X509 ::Certificate . new ( ruby_saml_cert_text ) }
398+ let ( :fingerprint ) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' }
399+
400+ it 'is valid' do
401+ assert document . validate_document_with_cert ( idp_cert ) , 'Document should be valid'
402+ end
403+ end
404+
405+ describe 'when response has no cert but you have local cert' do
406+ let ( :document ) { OneLogin ::RubySaml ::Response . new ( response_document_valid_signed_without_x509certificate ) . document }
407+ let ( :idp_cert ) { OpenSSL ::X509 ::Certificate . new ( ruby_saml_cert_text ) }
408+
409+ it 'is valid' do
410+ assert document . validate_document_with_cert ( idp_cert ) , 'Document should be valid'
411+ end
412+ end
413+ end
414+ end
391415 end
392416end
You can’t perform that action at this time.
0 commit comments