Skip to content

feat: read mdui:UIInfo from AuthnRequest and forward service name to GSSP#624

Open
kayjoosten wants to merge 2 commits into
mainfrom
feature/issue-591-service-name-saml-extension
Open

feat: read mdui:UIInfo from AuthnRequest and forward service name to GSSP#624
kayjoosten wants to merge 2 commits into
mainfrom
feature/issue-591-service-name-saml-extension

Conversation

@kayjoosten

@kayjoosten kayjoosten commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #591.

When EngineBlock sends a mdui:UIInfo extension in the AuthnRequest, Gateway now reads the mdui:DisplayName values and forwards the service name in a mdui:UIInfo extension on the proxy AuthnRequest sent to the GSSP.

  • Feature-flagged via enable_service_name_from_saml_authnrequest (disabled by default, configure in parameters.yaml)
  • Applies to both SSO (GatewayBundle) and SFO (SecondFactorOnlyBundle) flows
  • Priority: middleware service_name (from SP configuration) overrides mdui:DisplayName from the AuthnRequest

Priority table

Middleware service_name AuthnRequest mdui:DisplayName Result
No Yes AuthnRequest value forwarded
Yes Yes Middleware value used
No No No extension added
Yes No Middleware value forwarded

Changes

  • UiInfoExtensionHelper — parses and builds mdui:UIInfo SAML extensions
  • DisplayName — value object for type-safe lang/value pairs (serializes as plain arrays in session)
  • FeatureConfiguration — named accessor replacing raw bool constructor args
  • ProxyStateHandler — stores/retrieves DisplayName[] in session state
  • ResponseContext::resolveServiceDisplayNames() — applies priority logic with real SP data
  • SSO + SFO LoginService — parses UIInfo from incoming request via UiInfoExtensionHelper::parseAndStore
  • SecondFactorVerificationService — forwards resolved display names to GSSP proxy AuthnRequest
  • parameters.yaml.dist — documents the new flag

Test plan

  • composer test — 258 tests pass
  • composer phpstan — clean
  • composer phpcs — clean
  • composer phpmd — clean
  • composer phplint — clean
  • New tests: ProxyStateHandlerDisplayNameTest, ResponseContextResolveDisplayNamesTest, extended UiInfoExtensionHelperTest, SFO branch in SecondFactorVerificationServiceTest
  • Behat: requires Docker environment (devconf/stepup)
  • Enable flag in parameters.yaml and verify service name appears in GSSP AuthnRequest with EngineBlock sending feature_stepup_send_service_name=true

@kayjoosten
kayjoosten force-pushed the feature/issue-591-service-name-saml-extension branch from 0e6e735 to c1b3e59 Compare June 29, 2026 11:28
@kayjoosten
kayjoosten requested a review from johanib June 29, 2026 11:56
Gateway could only forward a service name to the GSSP when one was
configured in middleware metadata. When EngineBlock supplied the
service name via mdui:UIInfo on the incoming AuthnRequest, that
information was discarded and the proxied request reached the GSSP
without the SP display name.

Read mdui:DisplayName values from the incoming AuthnRequest when the
feature flag is enabled, store them in proxy state, and forward them
on the AuthnRequest sent to the GSSP. Middleware configuration keeps
precedence so existing explicit service_name values still win for both
SSO and SFO flows.

Resolves: #591
@kayjoosten
kayjoosten force-pushed the feature/issue-591-service-name-saml-extension branch from 6ff6b05 to 787a33b Compare July 10, 2026 11:09
@kayjoosten
kayjoosten force-pushed the feature/issue-591-service-name-saml-extension branch from e102674 to c1546f9 Compare July 14, 2026 11:33
…ride

The isServiceNameFromSamlAuthnRequestEnabled flag wrapped the entire
resolveServiceDisplayNames() call in SecondFactorVerificationService,
so disabling it also suppressed the middleware-configured service_name
override, not just the AuthnRequest-derived fallback it was meant to
gate.

resolveServiceDisplayNames() now takes an includeAuthnRequestFallback
parameter: the middleware override is always considered, while only
the AuthnRequest mdui:DisplayName fallback is gated behind the flag.
@kayjoosten
kayjoosten force-pushed the feature/issue-591-service-name-saml-extension branch from c1546f9 to 9641bcb Compare July 14, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose service name: Read + Write to SAML extension

1 participant