SAML-Toolkits / java-saml

Java SAML toolkit
MIT License
625 stars 391 forks source link

Using Multiple IDPs #258

Open RobertButtigieg opened 4 years ago

RobertButtigieg commented 4 years ago

Hi,

Is it possible that this library supports multiple IDPs, please?

Thanks, Robert

ryan13mt commented 4 years ago

+1 on having support for multiple IdPs

sunkaiqin commented 4 years ago

@RobertButtigieg Do you mean if this library could work with different IdPs? If so then yes. It worked very well with different IdPs. But I am not sure if you have any other specific requirements for supporting multiple IdPs in your case.

pitbulk commented 4 years ago

The setting builder is able to manage settings from:

You need to decide how you gonna manage the settings for your different IdPs, if you gonna store it in a database and then build the values object, or directly store different setting files.

You will need to add an idp_id or use the entity_id in each of your SAML endpoints to identify what IdP gonna be used and then initialize the Auth object with the right settings.

You can also implement a discovery IdP view to allow the user to select what IdP to use, for example on SP-initiated SSO flow.

The demo provided only works with 1 unique IdP but you can extend it with the recommendations I gave.

chenrui333 commented 3 years ago

That is pretty helpful, thanks @pitbulk!