Skip to content

Commit 16271c6

Browse files
committed
Bugfix: fix override over errorURL
1 parent c12a20c commit 16271c6

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

docs/simplesamlphp-changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Released TBD
1111

1212
* Fix auth state AuthnInstant (#2478)
1313
* Allow "Secure" cookie attribute via HTTP on localhost (#2483)
14+
* Fix override over errorURL
1415

1516
## Version 2.3.8
1617

modules/saml/src/IdP/SAML2.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,11 @@ public static function getHostedMetadata(string $entityid, ?MetaDataStorageHandl
962962
$metadata['RegistrationInfo'] = $config->getArray('RegistrationInfo');
963963
}
964964

965+
// Override errorURL if set
966+
if ($config->hasValue('errorURL')) {
967+
$metadata['errorURL'] = $config->getString('errorURL');
968+
}
969+
965970
// configure signature options
966971
if ($config->hasValue('validate.authnrequest')) {
967972
$metadata['sign.authnrequest'] = $config->getBoolean('validate.authnrequest');

tests/modules/saml/src/IdP/SAML2Test.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,20 @@ private function idpMetadataHandlerHelper(array $metadata, array $extraconfig =
262262
return SAML2::getHostedMetadata($metadata['entityid']);
263263
}
264264

265+
266+
/**
267+
* Test that an override for the errorURL produced the expected output.
268+
*/
269+
public function testIdPGetHostedMetadataErrorUrlOverride(): void
270+
{
271+
$md = [
272+
'errorURL' => 'https://simplesamlphp.org',
273+
];
274+
$hostedMd = $this->idpMetadataHandlerHelper($md);
275+
$this->assertEquals('https://simplesamlphp.org', $hostedMd['errorURL']);
276+
}
277+
278+
265279
/**
266280
* A minimally configured hosted IdP has all default fields with expected values.
267281
*/

0 commit comments

Comments
 (0)