Repository navigation
Support multiple SAML 2.0 Identity Providers (IdPs) - #106
Open
subbareddyalamur1 wants to merge 1 commit into
Open
subbareddyalamur1 wants to merge 1 commit into
subbareddyalamur1 wants to merge 1 commit into
Conversation
Author
|
Hi @LEDfan, tagging you for review whenever you have a moment! This PR adds backward-compatible multi-IdP SAML 2.0 support ( |
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
Adds backward-compatible support for configuring multiple SAML 2.0 Identity Providers (
proxy.saml.providers), while preserving 100% legacy single-IdP behavior when flatproxy.saml.*properties are used.src/main/java/eu/openanalytics/containerproxy/ ├── auth/impl/ │ ├── SAMLAuthenticationBackend.java # multi-IdP login/SLO URLs, per-user logout, IdP routing │ └── saml/ +│ ├── SamlProviderConfig.java # YAML & env-var relaxed binding + shared defaults + validation │ ├── SAMLConfiguration.java # multi-registration repo, DefaultRelyingPartyRegistrationResolver, per-IdP ForceAuthn │ ├── ResponseAuthenticationConverter.java # per-IdP name/roles/prefixes + preserve registrationId & sessionIndexes (Serializable) │ └── Saml2MetadataFilter.java # serves /saml/metadata and /saml/metadata/{registrationId} ├── security/WebSecurityConfig.java # permitAll /saml/metadata/** └── ui/AuthController.java # IdP chooser, ?idp= shortcut, hostname routing src/main/resources/ ├── templates/login.html # renders IdP selection buttons when samlProviders is present └── static/css/login.css # IdP button spacingExample Multi-IdP Configuration
Evidence
RelyingPartyRegistration(REG_ID = "shinyproxy") was registered;SAMLConfigurationhardcoded"shinyproxy"in token/logout resolvers,Saml2MetadataFilterserved only/saml/metadata,AuthControllerunconditionally redirected/loginto/saml2/authenticate/shinyproxy, andSaml2AuthenticatedPrincipaldroppedrelyingPartyRegistrationIdandsessionIndexes.mvn test -Dtest=TestSamlProviderConfig,TestSamlResponseAuthenticationConverter,SamlMultiIdpAuthenticationTest,SimpleAuthenticationTest,TestOpenIdParseClaimRoles: 16/16 passing (covers legacy single-IdP backward compatibility, multi-IdP metadata/chooser/?idp=/Hostrouting, per-IdPForceAuthn, signed SAML responses to/saml/SSO/{id}, cross-IdP signature rejection,LOCALvsSAMLper-IdP logout, env-var relaxed binding for Docker/Kubernetes, and Java serialization round-trip for Redis sessions).mvn -DskipTests clean install(includinglicense-maven-plugin:check): passed.idp-alphaandidp-beta): both IdPs authenticated independently, mapped per-IdP usernames/roles, and enforced per-IdP SpELaccess-expression: "#{samlCredential.relyingPartyRegistrationId == '...'}".Merge Danger
Door: Two-way
All changes are isolated to the SAML authentication backend and opt-in
proxy.saml.providersconfiguration; rollback is a clean revert.Blast Radius: Low
Legacy flat
proxy.saml.*configurations retain identical registration ID (shinyproxy), endpoints (/saml/SSO,/saml/metadata,/saml/logout,/saml/SingleLogout), and direct/loginredirect behavior. Non-SAML authentication backends are unaffected.