From d3cd4956e1d5be719af47575b83d343567d4e06c Mon Sep 17 00:00:00 2001 From: Kay Joosten Date: Fri, 10 Jul 2026 13:10:00 +0200 Subject: [PATCH 1/2] Add Stepup service display name Stepup currently receives a callout AuthnRequest without the requesting service's display name. That leaves the Stepup UI showing a generic proxy label instead of the application the user is logging in to, which makes the step-up prompt less clear. Add a dedicated Stepup AuthnRequest extension that emits the service DisplayName in the SAML extensions payload when the feature flag is enabled. The value follows the current EngineBlock locale, falls back to English when needed, and now validates the locale before resolving dynamic name fields so unsupported locales cannot break lookup. Resolves: #2011 --- config/packages/engineblock_features.yaml | 1 + config/packages/parameters.yml.dist | 1 + library/EngineBlock/Corto/ProxyServer.php | 12 +- .../Stepup/StepupServiceNameExtension.php | 73 +++++++ .../TestFeatureConfiguration.php | 1 + .../Features/Context/EngineBlockContext.php | 1 + .../Features/Stepup.feature | 17 ++ .../Stepup/StepupServiceNameExtensionTest.php | 178 ++++++++++++++++++ 8 files changed, 283 insertions(+), 1 deletion(-) create mode 100644 src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php create mode 100644 tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php diff --git a/config/packages/engineblock_features.yaml b/config/packages/engineblock_features.yaml index 2fbf8dbeda..64db4320b3 100644 --- a/config/packages/engineblock_features.yaml +++ b/config/packages/engineblock_features.yaml @@ -15,5 +15,6 @@ parameters: eb.feature_enable_idp_initiated_flow: "%feature_enable_idp_initiated_flow%" eb.stepup.sfo.override_engine_entityid: "%feature_stepup_sfo_override_engine_entityid%" eb.stepup.send_user_attributes: "%feature_stepup_send_user_attributes%" + eb.stepup.send_service_name: "%feature_stepup_send_service_name%" eb.feature_enable_sram_interrupt: "%feature_enable_sram_interrupt%" eb.hide_bookmarkable_url: "%feature_hide_bookmarkable_url%" diff --git a/config/packages/parameters.yml.dist b/config/packages/parameters.yml.dist index 18212e78e5..dd72f2c37a 100644 --- a/config/packages/parameters.yml.dist +++ b/config/packages/parameters.yml.dist @@ -235,6 +235,7 @@ parameters: feature_enable_idp_initiated_flow: true feature_stepup_sfo_override_engine_entityid: false feature_stepup_send_user_attributes: false + feature_stepup_send_service_name: false feature_enable_sram_interrupt: false feature_hide_bookmarkable_url: false diff --git a/library/EngineBlock/Corto/ProxyServer.php b/library/EngineBlock/Corto/ProxyServer.php index e53e62b962..13eaeac5b8 100644 --- a/library/EngineBlock/Corto/ProxyServer.php +++ b/library/EngineBlock/Corto/ProxyServer.php @@ -27,6 +27,7 @@ use OpenConext\EngineBlock\Metadata\Service; use OpenConext\EngineBlock\Metadata\TransparentMfaEntity; use OpenConext\EngineBlock\Stepup\StepupGsspUserAttributeExtension; +use OpenConext\EngineBlock\Stepup\StepupServiceNameExtension; use OpenConext\EngineBlock\Metadata\X509\KeyPairFactory; use OpenConext\EngineBlockBundle\Authentication\AuthenticationState; use OpenConext\EngineBlockBundle\Exception\UnknownKeyIdException; @@ -486,7 +487,8 @@ public function sendStepupAuthenticationRequest( Loa $authnContextClassRef, NameID $nameId, bool $isForceAuthn, - Assertion $originalAssertion + Assertion $originalAssertion, + ?ServiceProvider $sp = null, ): void { $ebRequest = EngineBlock_Saml2_AuthnRequestFactory::createFromRequest( $spRequest, @@ -555,6 +557,13 @@ public function sendStepupAuthenticationRequest( } } + $isSendServiceNameConfigured = $features->hasFeature('eb.stepup.send_service_name'); + $isSendServiceNameEnabled = $features->isEnabled('eb.stepup.send_service_name'); + + if ($isSendServiceNameConfigured && $isSendServiceNameEnabled && $sp !== null) { + $locale = $container->getLocaleProvider()->getLocale(); + StepupServiceNameExtension::add($sspMessage, $sp, $locale); + } // Link with the original Request $diContainerRuntime = EngineBlock_ApplicationSingleton::getInstance()->getDiContainerRuntime(); @@ -635,6 +644,7 @@ public function handleStepupAuthenticationCallout( $nameId, $sp->getCoins()->isStepupForceAuthn(), $originalAssertion, + $sp, ); } diff --git a/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php b/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php new file mode 100644 index 0000000000..c4612ca0fb --- /dev/null +++ b/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php @@ -0,0 +1,73 @@ +createElementNS(self::MDUI_NS, 'mdui:UIInfo'); + $displayName = $dom->createElementNS(self::MDUI_NS, 'mdui:DisplayName'); + $displayName->setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', $resolvedLocale); + $displayName->textContent = $name; + $uiInfo->appendChild($displayName); + + $ext = $message->getExtensions(); + $ext['mdui:UIInfo'] = new Chunk($uiInfo); + $message->setExtensions($ext); + } + + /** + * @return array{string, string}|null + */ + private static function resolveName(ServiceProvider $sp, string $locale): ?array + { + $name = $sp->getMdui()->getDisplayNameOrNull($locale); + if (empty($name)) { + $name = $sp->{'name' . ucfirst($locale)}; + } + if (empty($name)) { + return null; + } + return [$locale, $name]; + } +} diff --git a/src/OpenConext/EngineBlockBundle/Configuration/TestFeatureConfiguration.php b/src/OpenConext/EngineBlockBundle/Configuration/TestFeatureConfiguration.php index f6fa8285c8..e72dc7f2b7 100644 --- a/src/OpenConext/EngineBlockBundle/Configuration/TestFeatureConfiguration.php +++ b/src/OpenConext/EngineBlockBundle/Configuration/TestFeatureConfiguration.php @@ -47,6 +47,7 @@ public function __construct() $this->setFeature(new Feature('eb.stepup.sfo.override_engine_entityid', false)); $this->setFeature(new Feature('eb.feature_enable_idp_initiated_flow', true)); $this->setFeature(new Feature('eb.stepup.send_user_attributes', true)); + $this->setFeature(new Feature('eb.stepup.send_service_name', false)); $this->setFeature(new Feature('eb.feature_enable_sram_interrupt', true)); $this->setFeature(new Feature('eb.hide_bookmarkable_url', true)); } diff --git a/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Context/EngineBlockContext.php b/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Context/EngineBlockContext.php index 7e94d564b0..f7dba64249 100644 --- a/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Context/EngineBlockContext.php +++ b/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Context/EngineBlockContext.php @@ -688,6 +688,7 @@ public function theAuthnRequestToSubmitShouldMatchXpath($xpath) $xpathObject = new DOMXPath($authnRequest); $xpathObject->registerNamespace('gssp', 'urn:mace:surf.nl:stepup:gssp-extensions'); + $xpathObject->registerNamespace('mdui', 'urn:oasis:names:tc:SAML:metadata:ui'); $nodeList = $xpathObject->query($xpath); if (!$nodeList || $nodeList->length === 0) { diff --git a/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Stepup.feature b/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Stepup.feature index ccb8d42c1d..d13e589d89 100644 --- a/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Stepup.feature +++ b/src/OpenConext/EngineBlockFunctionalTestingBundle/Features/Stepup.feature @@ -291,3 +291,20 @@ Feature: And I pass through EngineBlock And I pass through the IdP Then the received AuthnRequest should match xpath '/samlp:AuthnRequest/samlp:Extensions/gssp:UserAttributes/saml:Attribute[@Name="urn:mace:dir:attribute-def:mail"]/saml:AttributeValue[text()="j.doe@institution-a.example.org"]' + + Scenario: Stepup callout includes service name in mdui:UIInfo when feature is enabled + Given the SP "SSO-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa2" + And feature "eb.stepup.send_service_name" is enabled + When I log in at "SSO-SP" + And I select "SSO-IdP" on the WAYF + And I pass through EngineBlock + And I pass through the IdP + Then the received AuthnRequest should match xpath '/samlp:AuthnRequest/samlp:Extensions/mdui:UIInfo/mdui:DisplayName' + + Scenario: Stepup callout does not include service name in mdui:UIInfo when feature is disabled + Given the SP "SSO-SP" requires Stepup LoA "http://dev.openconext.local/assurance/loa2" + When I log in at "SSO-SP" + And I select "SSO-IdP" on the WAYF + And I pass through EngineBlock + And I pass through the IdP + Then the received AuthnRequest should not match xpath '/samlp:AuthnRequest/samlp:Extensions/mdui:UIInfo/mdui:DisplayName' diff --git a/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php b/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php new file mode 100644 index 0000000000..5f460200eb --- /dev/null +++ b/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php @@ -0,0 +1,178 @@ +spWithNames('My Service EN', 'Mijn Service NL'); + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'nl'); + + $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="nl"]'); + $this->assertSame(1, $nodes->length); + $this->assertSame('Mijn Service NL', $nodes->item(0)->textContent); + } + + public function testFallsBackToEnglishWhenRequestedLocaleHasNoName(): void + { + $sp = $this->spWithNames('My Service EN'); + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'nl'); + + $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); + $this->assertSame(1, $nodes->length); + $this->assertSame('My Service EN', $nodes->item(0)->textContent); + } + + public function testAddsNoExtensionWhenNeitherLocaleNorEnglishHasName(): void + { + $sp = $this->spWithNames(); + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'nl'); + + $ext = $request->getExtensions(); + $this->assertArrayNotHasKey('mdui:UIInfo', $ext); + } + + public function testMduiDisplayNameTakesPrecedenceOverFlatField(): void + { + $sp = $this->spWithMduiDisplayName('en', 'Mdui Service Name'); + $sp->nameEn = 'Flat Field Name'; + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'en'); + + $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); + $this->assertSame(1, $nodes->length); + $this->assertSame('Mdui Service Name', $nodes->item(0)->textContent); + } + + public function testLocaleTagMatchesActualContentLocale(): void + { + $sp = $this->spWithNames('Only English Name'); + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'nl'); + + $nlNodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="nl"]'); + $enNodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); + $this->assertSame(0, $nlNodes->length, 'Should not add nl tag when using en fallback'); + $this->assertSame(1, $enNodes->length, 'Should add en tag matching the actual content locale'); + } + + public function testFallsBackToFlatFieldWhenMduiDisplayNameIsEmpty(): void + { + $mduiJson = '{"DisplayName":{"name":"DisplayName","values":{"en":{"value":"","language":"en"}}},' + . '"Description":{"name":"Description"},"Keywords":{"name":"Keywords"},' + . '"Logo":{"name":"Logo"},"PrivacyStatementURL":{"name":"PrivacyStatementURL"}}'; + $sp = new ServiceProvider('https://sp.example.org', Mdui::fromJson($mduiJson)); + $sp->nameEn = 'Flat Field Name'; + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'en'); + + $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); + $this->assertSame(1, $nodes->length); + $this->assertSame('Flat Field Name', $nodes->item(0)->textContent); + } + + public function testPreservesExistingExtensions(): void + { + $sp = $this->spWithNames('My Service'); + $request = new AuthnRequest(); + $request->setExtensions(['existing:Extension' => new Chunk( + (new DOMDocument())->createElement('existing:Extension') + )]); + + StepupServiceNameExtension::add($request, $sp, 'en'); + + $ext = $request->getExtensions(); + $this->assertArrayHasKey('existing:Extension', $ext); + $this->assertArrayHasKey('mdui:UIInfo', $ext); + } + + public function testUnsupportedLocaleFallsBackToEnglish(): void + { + $sp = $this->spWithNames('My Service EN', 'Mijn Service NL'); + $request = new AuthnRequest(); + + StepupServiceNameExtension::add($request, $sp, 'en/../evil'); + + $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); + $this->assertSame(1, $nodes->length); + $this->assertSame('My Service EN', $nodes->item(0)->textContent); + } + + private function spWithNames(string $nameEn = '', string $nameNl = '', string $namePt = ''): ServiceProvider + { + $sp = new ServiceProvider('https://sp.example.org'); + $sp->nameEn = $nameEn; + $sp->nameNl = $nameNl; + $sp->namePt = $namePt; + return $sp; + } + + private function spWithMduiDisplayName(string $locale, string $displayName): ServiceProvider + { + $mduiJson = sprintf( + '{"DisplayName":{"name":"DisplayName","values":{"%s":{"value":"%s","language":"%s"}}},' + . '"Description":{"name":"Description"},"Keywords":{"name":"Keywords"},' + . '"Logo":{"name":"Logo"},"PrivacyStatementURL":{"name":"PrivacyStatementURL"}}', + $locale, + $displayName, + $locale + ); + return new ServiceProvider('https://sp.example.org', Mdui::fromJson($mduiJson)); + } + + private function getExtensionElement(AuthnRequest $request): DOMElement + { + $ext = $request->getExtensions(); + $this->assertArrayHasKey('mdui:UIInfo', $ext); + $chunk = $ext['mdui:UIInfo']; + $this->assertInstanceOf(Chunk::class, $chunk); + return $chunk->getXML(); + } + + private function queryXpath(AuthnRequest $request, string $expression): DOMNodeList + { + $el = $this->getExtensionElement($request); + $xpath = new DOMXPath($el->ownerDocument); + $xpath->registerNamespace('mdui', 'urn:oasis:names:tc:SAML:metadata:ui'); + $xpath->registerNamespace('xml', 'http://www.w3.org/XML/1998/namespace'); + return $xpath->query($expression, $el); + } +} From fde41c1cadd3d972ea5faddec18a07f621df69ac Mon Sep 17 00:00:00 2001 From: Kay Joosten Date: Fri, 24 Jul 2026 15:24:27 +0200 Subject: [PATCH 2/2] Resolve Stepup service name from configured locales, not hardcoded ones If applied, this commit will make the Stepup service-display-name extension use EngineBlock's configured default/available locales instead of a hardcoded locale set, and drop a dynamic property lookup in favor of an explicit match. Why is this change needed? StepupServiceNameExtension hardcoded SUPPORTED_LOCALES = ['en', 'nl', 'pt'] and fell back to the literal string 'en', independent of how the instance is actually configured. It also read the localized name via $sp->{'name' . ucfirst($locale)}, a dynamic property access that duplicates logic already present in ServiceProvider::getDisplayName(). How does it address the issue? Adds getDefaultLocale() and getAvailableLocales() to LocaleProvider, and passes both into StepupServiceNameExtension::add() from ProxyServer, replacing the hardcoded whitelist and 'en' literal. Replaces the dynamic property read with an explicit match over the three schema-backed name columns. Adds a CHANGELOG entry for the eb.stepup.send_service_name feature flag. Links / references: https://github.com/OpenConext/OpenConext-engineblock/pull/2034 --- CHANGELOG.md | 4 +++ library/EngineBlock/Corto/ProxyServer.php | 10 ++++-- .../Stepup/StepupServiceNameExtension.php | 33 ++++++++++++++----- .../Localization/LocaleProvider.php | 16 +++++++++ .../Stepup/StepupServiceNameExtensionTest.php | 16 ++++----- 5 files changed, 61 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e82ba79038..975832a9c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ More information about our release strategy can be found in the [Development Guidelines](https://github.com/OpenConext/OpenConext-engineblock/wiki/Development-Guidelines#release-notes) on the EngineBlock wiki. +## UNRELEASED +Features: +* Added `eb.stepup.send_service_name` feature flag. When enabled, EngineBlock adds an `mdui:UIInfo`/`DisplayName` extension with the SP's display name to the Stepup callout AuthnRequest (#2034). + ## 7.2.0 Maintenance: diff --git a/library/EngineBlock/Corto/ProxyServer.php b/library/EngineBlock/Corto/ProxyServer.php index 13eaeac5b8..66a996a93f 100644 --- a/library/EngineBlock/Corto/ProxyServer.php +++ b/library/EngineBlock/Corto/ProxyServer.php @@ -561,8 +561,14 @@ public function sendStepupAuthenticationRequest( $isSendServiceNameEnabled = $features->isEnabled('eb.stepup.send_service_name'); if ($isSendServiceNameConfigured && $isSendServiceNameEnabled && $sp !== null) { - $locale = $container->getLocaleProvider()->getLocale(); - StepupServiceNameExtension::add($sspMessage, $sp, $locale); + $localeProvider = $container->getLocaleProvider(); + StepupServiceNameExtension::add( + $sspMessage, + $sp, + $localeProvider->getLocale(), + $localeProvider->getDefaultLocale(), + $localeProvider->getAvailableLocales(), + ); } // Link with the original Request diff --git a/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php b/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php index c4612ca0fb..cb306c57e3 100644 --- a/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php +++ b/src/OpenConext/EngineBlock/Stepup/StepupServiceNameExtension.php @@ -28,16 +28,23 @@ final class StepupServiceNameExtension { private const MDUI_NS = 'urn:oasis:names:tc:SAML:metadata:ui'; - private const SUPPORTED_LOCALES = ['en', 'nl', 'pt']; - public static function add(Message $message, ServiceProvider $sp, string $locale): void - { - if (!in_array($locale, self::SUPPORTED_LOCALES, true)) { - $locale = 'en'; + /** + * @param string[] $availableLocales + */ + public static function add( + Message $message, + ServiceProvider $sp, + string $locale, + string $defaultLocale, + array $availableLocales, + ): void { + if (!in_array($locale, $availableLocales, true)) { + $locale = $defaultLocale; } $result = self::resolveName($sp, $locale); - if ($result === null && $locale !== 'en') { - $result = self::resolveName($sp, 'en'); + if ($result === null && $locale !== $defaultLocale) { + $result = self::resolveName($sp, $defaultLocale); } if ($result === null) { return; @@ -63,11 +70,21 @@ private static function resolveName(ServiceProvider $sp, string $locale): ?array { $name = $sp->getMdui()->getDisplayNameOrNull($locale); if (empty($name)) { - $name = $sp->{'name' . ucfirst($locale)}; + $name = self::localizedName($sp, $locale); } if (empty($name)) { return null; } return [$locale, $name]; } + + private static function localizedName(ServiceProvider $sp, string $locale): ?string + { + return match ($locale) { + 'en' => $sp->nameEn, + 'nl' => $sp->nameNl, + 'pt' => $sp->namePt, + default => null, + }; + } } diff --git a/src/OpenConext/EngineBlockBundle/Localization/LocaleProvider.php b/src/OpenConext/EngineBlockBundle/Localization/LocaleProvider.php index 377a7c472f..2311219eee 100644 --- a/src/OpenConext/EngineBlockBundle/Localization/LocaleProvider.php +++ b/src/OpenConext/EngineBlockBundle/Localization/LocaleProvider.php @@ -57,6 +57,22 @@ public function scopeWithRequest(Request $request) $this->request = $request; } + /** + * @return string + */ + public function getDefaultLocale() + { + return $this->defaultLocale; + } + + /** + * @return string[] + */ + public function getAvailableLocales() + { + return $this->availableLocales; + } + /** * @return string */ diff --git a/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php b/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php index 5f460200eb..8b155bd5c4 100644 --- a/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php +++ b/tests/unit/OpenConext/EngineBlock/Stepup/StepupServiceNameExtensionTest.php @@ -37,7 +37,7 @@ public function testAddsDisplayNameForRequestedLocale(): void $sp = $this->spWithNames('My Service EN', 'Mijn Service NL'); $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'nl'); + StepupServiceNameExtension::add($request, $sp, 'nl', 'en', ['en', 'nl', 'pt']); $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="nl"]'); $this->assertSame(1, $nodes->length); @@ -49,7 +49,7 @@ public function testFallsBackToEnglishWhenRequestedLocaleHasNoName(): void $sp = $this->spWithNames('My Service EN'); $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'nl'); + StepupServiceNameExtension::add($request, $sp, 'nl', 'en', ['en', 'nl', 'pt']); $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); $this->assertSame(1, $nodes->length); @@ -61,7 +61,7 @@ public function testAddsNoExtensionWhenNeitherLocaleNorEnglishHasName(): void $sp = $this->spWithNames(); $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'nl'); + StepupServiceNameExtension::add($request, $sp, 'nl', 'en', ['en', 'nl', 'pt']); $ext = $request->getExtensions(); $this->assertArrayNotHasKey('mdui:UIInfo', $ext); @@ -73,7 +73,7 @@ public function testMduiDisplayNameTakesPrecedenceOverFlatField(): void $sp->nameEn = 'Flat Field Name'; $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'en'); + StepupServiceNameExtension::add($request, $sp, 'en', 'en', ['en', 'nl', 'pt']); $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); $this->assertSame(1, $nodes->length); @@ -85,7 +85,7 @@ public function testLocaleTagMatchesActualContentLocale(): void $sp = $this->spWithNames('Only English Name'); $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'nl'); + StepupServiceNameExtension::add($request, $sp, 'nl', 'en', ['en', 'nl', 'pt']); $nlNodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="nl"]'); $enNodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); @@ -102,7 +102,7 @@ public function testFallsBackToFlatFieldWhenMduiDisplayNameIsEmpty(): void $sp->nameEn = 'Flat Field Name'; $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'en'); + StepupServiceNameExtension::add($request, $sp, 'en', 'en', ['en', 'nl', 'pt']); $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); $this->assertSame(1, $nodes->length); @@ -117,7 +117,7 @@ public function testPreservesExistingExtensions(): void (new DOMDocument())->createElement('existing:Extension') )]); - StepupServiceNameExtension::add($request, $sp, 'en'); + StepupServiceNameExtension::add($request, $sp, 'en', 'en', ['en', 'nl', 'pt']); $ext = $request->getExtensions(); $this->assertArrayHasKey('existing:Extension', $ext); @@ -129,7 +129,7 @@ public function testUnsupportedLocaleFallsBackToEnglish(): void $sp = $this->spWithNames('My Service EN', 'Mijn Service NL'); $request = new AuthnRequest(); - StepupServiceNameExtension::add($request, $sp, 'en/../evil'); + StepupServiceNameExtension::add($request, $sp, 'en/../evil', 'en', ['en', 'nl', 'pt']); $nodes = $this->queryXpath($request, './/mdui:DisplayName[@xml:lang="en"]'); $this->assertSame(1, $nodes->length);