Legacy Knowledge Base
Published Sep. 10, 2025

How to set two Liferays as separate SAML and IdP servers?

Written By

Zsuzsa Emese Kállai

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

  • How to set two Liferays as separate SAML and IdP servers?

Environment

  • Liferay DXP Quarterly Release

Resolution

Configure and setup first bundle:

  1. Add portlet.session.replicate.enabled=true to portal-ext.properties in both bundles
  2. Startup the first local bundle with default port settings
  3. Wait until bundle finished the startup process

Configure and setup second bundle:

  1. Modify lines in tomcat/config/server.xml
    <Server port="8005" shutdown="SHUTDOWN">
    <Connector maxThreads="75" port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxParameterCount="1000"/>
  2. Download and copy com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config file into /osgi/configs

    Use this file only for testing purposes

  3. Add the following line in your host file 127.0.0.1 localhost2
  4. Startup the second local bundle

Set up the Service Provider:

  1. Visit http://localhost:8080/
  2. Go to the Control Panel → Instance Settings → Instance Configuration → General tab
  3. Set Name to Service Provider
  4. Go to Control Panel → SAML Admin → General
    1. SAML Role: Service Provider
    2. Entity ID: sp
  5. Click on Save
  6. Check Enabled
  7. Click on Save

Set up the Identity Provider Connection:

  1. Go to Control Panel → SAML Admin → Service Provider Connections
  2. Click on Add Service Provider
  3. In the New Identity Provider window
    1. Name: Identity Provider
    2. Select Enabled
    3. Entity Id: idp
    4. Choose connect to metadata URL option
    5. Metadata URL: http://localhost2:8081/c/portal/saml/metadata
    6. Name Identifier Format: Email Address
    7. Name Identifier Attribute Name: emailAddress

Set up the Identity Provider:

  1. Visit http://localhost:8081/
  2. Go to the Control Panel → Instance Settings → Instance Configuration → General tab
  3. Set name to Service Provider
  4. Set Virtual Host to localhost2
  5. Go to Control Panel → SAML Admin → General
    1. SAML Role: Identity Provider
    2. Entity ID : idp
    3. Click on Save
    4. Check Enabled
    5. Click on Save

Set up the Service Provider Connection:

  1. Go to Control Panel → SAML Admin → Service Provider Connections
  2. Click on Add Service Provider
  3. On the New Service Provider window
    1. Name: Service Provider
    2. Select Enabled
    3. Entity Id: sp
  4. Choose connect to metadata URL option
  5. Meta data URL: http://localhost:8080/c/portal/saml/metadata
  6. Name Identifier Format: Email Address
  7. Name Identifier Attribute Name: emailAddress

Usage:

  1. Visit http://localhost:8080/
  2. Click on Sign In
  3. You are redirected to the Identity Provider
  4. Sing in with your credentials
  5. You are redirected to the Service Provider

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base