Issue
Users are facing intermittent login issues in the SAML environment; however, the below error is observed frequently in their log files:
Environment
- Liferay DXP 7.4
Resolution
Following are the suggestions that might help to resolve this issue:
- In general, the SSO process identifies a SAML SSO request and so the session for that portal process is created as a brand new one.
- However, if there is an already existing session on the portal side then that might result in this error. Please note that the Liferay portal handles a SAML SSO request and its session as a new one if there is no value of the
SAML_SSO_SESSION_IDin the request. - The other cause for this can be inconsistency in entity ID generation on the DB level.
- In order to confirm the inconsistency in entity ID generation, check if the value of the
currentIdfield in theCounterDB table for the entry whose name iscom.liferay.saml.persistence.model.SamlIdpSsoSessionis higher than the highest value of thesamlIdpSsoSessionIdin theSamlIdpSsoSessionDB table. - The
SamlIdpSsoSessioncreation logic uses thiscurrentIdvalue to generate the value for thesamlIdpSsoSessionIdfor the newSamlIdpSsoSessionentity. - If the
currentIdvalue is lower then it should be set higher than the the highest value of thesamlIdpSsoSessionIdin theSamlIdpSsoSessionDB table.