Configuring Multiple Identity Providers (IDPs) for SAML Authentication in Spring 5

249 views Asked by At

I've successfully implemented SAML-based Single Sign-On (SSO) using Spring 5 with the guidance provided in the tutorial https://isd-soft.com/tech_blog/diving-sso-spring-saml-ssocircle/. The configuration is currently set up for a single Identity Provider (IDP), as outlined in the tutorial.

Now, I'm looking to expand the SSO setup to accommodate multiple IDPs. Specifically, I want to configure an additional IDP, allowing the system to redirect authentication requests to the appropriate IDP based on the URL endpoint. For instance, accessing /idp1 should direct users to IDP1 for authentication, and accessing /idp2 should redirect to IDP2 for authentication.

The technology stack I'm using includes:

Spring 5 Dependency: spring-security-saml2-core version 1.0.10.RELEASE I'm seeking guidance on how to extend the existing SAML configuration to support multiple IDPs dynamically based on the URL endpoint. What changes or configurations do I need to make within the Spring SAML setup to enable this functionality?

Any insights, code examples, or relevant documentation would be greatly appreciated. Thank you in advance for your help.

1

There are 1 answers

0
Gianpaolo Basilicò On

you might need some refactoring but it seems that spring-security (SAML federation chapter) could be what you are looking for

You can find an example of usage here