Skip to content

Commit

Permalink
Accept empty assertion of attribute query response
Browse files Browse the repository at this point in the history
  • Loading branch information
shingo78 committed Jan 9, 2020
1 parent e869cae commit 653466e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Auth/Process/attributeaggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,13 @@ public function process(&$state)
$response->getStatus()['Code'].')');
}
// merge attributes
$assertion = $response->getAssertions()[0]; // TODO Can there be more than 1?
if (empty($assertion)) {
throw new RuntimeException('Got an empty SAML Response');
$assertions = $response->getAssertions();
if (!empty($assertions)) {
$attributes_from_aa = $assertions[0]->getAttributes();
} else {
$attributes_from_aa = array();
}
$this->mergeAttributes($state, $assertion->getAttributes());
$this->mergeAttributes($state, $attributes_from_aa);

} catch (Exception $e) {
\SimpleSAML\Logger::info("Attribute query failed: ".$e->getMessage());
Expand Down

0 comments on commit 653466e

Please sign in to comment.