File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class OneLogin_Saml2_ValidationError extends Exception
7878    const  WRONG_DESTINATION  = 24 ;
7979    const  EMPTY_DESTINATION  = 25 ;
8080    const  WRONG_AUDIENCE  = 26 ;
81-     const  ISSUER_NOT_FOUND_IN_RESPONSE  = 27 ;
81+     const  ISSUER_MULTIPLE_IN_RESPONSE  = 27 ;
8282    const  ISSUER_NOT_FOUND_IN_ASSERTION  = 28 ;
8383    const  WRONG_ISSUER  = 29 ;
8484    const  SESSION_EXPIRED  = 30 ;
Original file line number Diff line number Diff line change @@ -523,13 +523,15 @@ public function getIssuers()
523523        $ issuersarray ();
524524
525525        $ responseIssuerquery ($ this document , '/samlp:Response/saml:Issuer ' );
526-         if  ($ responseIssuerlength  == 1 ) {
527-             $ issuers$ responseIssueritem (0 )->textContent ;
528-         } else  {
529-             throw  new  OneLogin_Saml2_ValidationError (
530-                 "Issuer of the Response not found or multiple. " ,
531-                 OneLogin_Saml2_ValidationError::ISSUER_NOT_FOUND_IN_RESPONSE 
532-             );
526+         if  ($ responseIssuerlength  > 0 ) {
527+             if  ($ responseIssuerlength  == 1 ) {
528+                 $ issuers$ responseIssueritem (0 )->textContent ;
529+             } else  {
530+                 throw  new  OneLogin_Saml2_ValidationError (
531+                     "Issuer of the Response is multiple. " ,
532+                     OneLogin_Saml2_ValidationError::ISSUER_MULTIPLE_IN_RESPONSE 
533+                 );
534+             }
533535        }
534536
535537        $ assertionIssuer$ this _queryAssertion ('/saml:Issuer ' );
Original file line number Diff line number Diff line change @@ -490,12 +490,8 @@ public function testGetIssuers()
490490
491491        $ xml4file_get_contents (TEST_ROOT  . '/data/responses/invalids/no_issuer_response.xml.base64 ' );
492492        $ response4new  OneLogin_Saml2_Response ($ this _settings , $ xml4
493-         try  {
494-             $ issuers$ response4getIssuers ();
495-             $ this fail ('OneLogin_Saml2_ValidationError was not raised ' );
496-         } catch  (OneLogin_Saml2_ValidationError $ e
497-             $ this assertContains ('Issuer of the Response not found or multiple. ' , $ egetMessage ());
498-         }
493+         $ issuers$ response4getIssuers ();
494+         $ this assertEquals (array ('http://idp.example.com/ ' ), $ response4getIssuers ());
499495
500496        $ xml5file_get_contents (TEST_ROOT  . '/data/responses/invalids/no_issuer_assertion.xml.base64 ' );
501497        $ response5new  OneLogin_Saml2_Response ($ this _settings , $ xml5
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments