Display service name from mdui:UIInfo on authentication/registration pages#141
Open
kayjoosten wants to merge 1 commit into
Open
Display service name from mdui:UIInfo on authentication/registration pages#141kayjoosten wants to merge 1 commit into
kayjoosten wants to merge 1 commit into
Conversation
3 tasks
kayjoosten
added a commit
that referenced
this pull request
Jul 3, 2026
- Demo SP: gate the mdui extension on either ServiceNameEn or ServiceNameNl being present, not English only. Filling in only the Dutch field previously sent no mdui extension at all, silently breaking the Dutch-only test path. - ServiceNameResolver: normalize xml:lang keys (lowercase, language subtag only) before matching, so "en-US" or "EN" on the wire still match the "en" locale/fallback lookup instead of falling through to "first available". - ServiceNameFormatterTest: replace the self-referential mb_substr(...) expected value in the combination-of-rules case with a literal string, so the test can't pass on a shared misunderstanding of mb_substr with the implementation.
kayjoosten
added a commit
that referenced
this pull request
Jul 3, 2026
- Demo SP: gate the mdui extension on either ServiceNameEn or ServiceNameNl being present, not English only. Filling in only the Dutch field previously sent no mdui extension at all, silently breaking the Dutch-only test path. - ServiceNameResolver: normalize xml:lang keys (lowercase, language subtag only) before matching, so "en-US" or "EN" on the wire still match the "en" locale/fallback lookup instead of falling through to "first available". - ServiceNameFormatterTest: replace the self-referential mb_substr(...) expected value in the combination-of-rules case with a literal string, so the test can't pass on a shared misunderstanding of mb_substr with the implementation.
42f6e95 to
b9f22a5
Compare
3f33907 to
6192f1d
Compare
Prior to this change, the registration and authentication pages gave no indication of which service the second-factor action was for, leaving end users unable to confirm they were acting on the SP they expected. This change resolves the service name from the AuthnRequest's mdui:UIInfo metadata (via ServiceNameResolver/ServiceNameFormatter, now provided by stepup-gssp-bundle) and renders it on the authentication and registration templates. The demo SP controller and templates are extended so the mdui:UIInfo fields can be exercised locally, and Behat scenarios cover the new display behaviour. Also included: - Bump the stepup-gssp-bundle dependency to the branch that exposes ServiceNameResolver/Formatter - Skip phpunit gracefully instead of failing when tests/Unit is empty Resolves: #140
6192f1d to
96cd560
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #140.
Displays the service name (
mdui:DisplayNamefrom amdui:UIInfoSAML extension in the incoming AuthnRequest) on both the authentication and registration pages, so users can verify which service they're authenticating to.ServiceNameFormatter/ServiceNameResolver(src/Surfnet/Gssp/Domain/ServiceName/) — cleans/truncates the raw display name (max 40 chars + ellipsis, whitespace trim/collapse, control/format char stripping) and picks the right language (request locale →en→ first available), per the shared multi-repo spec.DefaultController'sauthentication()/registration()actions, both templates, and translations (en/nl). Renders nothing if no mdui data is present — no error./demo/sp) got two new optional fields,ServiceNameEn/ServiceNameNl, so the whole flow is testable locally without EngineBlock/Gateway deployed, plus new@remoteBehat scenarios exercising it.Dependency
Requires Stepup-gssp-bundle#49, which adds
AuthenticationService::getMdui()/RegistrationService::getMdui()exposing the session-stored mdui data to downstream GSSP apps.composer.jsoncurrently points at that PR's branch via a VCS repository +dev-requirement, withminimum-stability: dev(matching the same pattern already used in gssp-bundle's own composer.json) — this needs to be swapped to a tagged release once #49 merges.Test plan
composer phpstan/composer phpcscleancomposer test— 15/15 PHPUnit tests passing@remoteBehat scenarios (sp_authentication.feature,sp_registration.feature) — need a running local instance to execute; dry-run confirms all scenarios/steps parse with no undefined steps