Legacy Knowledge Base
Published Sep. 10, 2025

Info about new parameters for SamlSpIdpConnectionLocalService.addSaml and updateSaml

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • We are upgrading our code from 7.3 to 2024Q1.7, we found a new parameter for the two following methods:

    1. _samlSpIdpConnectionLocalService.addSamlSpIdpConnection()
    2. _samlSpIdpConnectionLocalService.updateSamlSpIdpConnection()
    The new parameters are boolean unknownUsersAreStrangers and String userIdentifierExpression.
     
    What are these new parameters for?

Environment

  • 2024.Q1

Resolution

  • Regarding the first parameter you mention: unknownUsersAreStrangers:

SAML is a standards based protocol and a very large number of products & services can act as SAML IdPs. As such, controls over which users should be automatically provisioned on the SP when they do not already exist there need to be on a per SAML IdP connection basis.

The SamlSpIdpConnection entity was extended with a "unknownUsersAreStrangers" field of type boolean.

This field defines if users that do not exist already in the portal database should be classified as "strangers". Once classified, the portal instance's existing stranger handling policy as defined in Instance Settings > User Authentication > General will determine if the user will be automatically provisioned or not using information available from the IdP's SAML assertion.

 

This connects to the “Unknown Users Are Strangers“ SAML IdP config entry that can be set at editing entries at “Control Panel > SECURITY > SAML Admin > Identity Provider Connections”. When it is enabled, so its value is true, the stranger handling that is configured at “Control Panel > CONFIGURATION > Instance Settings > User Authentication” is being applied.

 

Checking the “Unknown Users Are Strangers“ SAML IdP config entry at editing entries at “Control Panel > SECURITY > SAML Admin > Identity Provider Connections” results that the same logic is applied at importing the user data through the SAML connection that is configured for the stranger handling at the “Control Panel > CONFIGURATION > Instance Settings > User Authentication” for the “Allow strangers to create accounts?” entry.

  • userIdentifierExpression
     

    {UserFieldExpressionResolver_key}[:argument]

    An expression to identify the UserFieldExpressionResolver to use to resolve a UserFieldExpression to use for user matching. Mostly it is synonymous to UserFieldExpressionResolver_key , and out of the box there are 3: “none”, “dynamic”, “attribute”.

    The UserIdentifierExpression is stored into the SamlSpIdpConnection.

    This field connects to the “User Resolution“ field at editing entries at “Control Panel > SECURITY > SAML Admin > Identity Provider Connections”. The radio button entries has the “none”, “dynamic”, “attribute” values in this order. However this list is dynamically built based on implementations of the UserFieldExpressionResolver SPI .

    It is an implementation detail of each UserFieldExpressionResolver SPI implementation if it requires [:argument] when it is used by DefaultUserResolver to resolve the user.

    At the time of writing, only the “attribute” one requires this OoTB. See

 

 

Did this article resolve your issue ?

Legacy Knowledge Base