Issue
- How to set two Liferays as separate SAML and IdP servers?
Environment
- Liferay DXP Quarterly Release
Resolution
Configure and setup first bundle:
- Add
portlet.session.replicate.enabled=true
to portal-ext.properties in both bundles - Startup the first local bundle with default port settings
- Wait until bundle finished the startup process
Configure and setup second bundle:
- 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"/>
- Download and copy com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config file into /osgi/configs
↳ Use this file only for testing purposes
- Add the following line in your host file
127.0.0.1 localhost2
- Startup the second local bundle
Set up the Service Provider:
- Visit http://localhost:8080/
- Go to the Control Panel → Instance Settings → Instance Configuration → General tab
- Set Name to Service Provider
- Go to Control Panel → SAML Admin → General
- SAML Role: Service Provider
- Entity ID: sp
- Click on Save
- Check Enabled
- Click on Save
Set up the Identity Provider Connection:
- Go to Control Panel → SAML Admin → Service Provider Connections
- Click on Add Service Provider
- In the New Identity Provider window
- Name: Identity Provider
- Select Enabled
- Entity Id: idp
- Choose connect to metadata URL option
- Metadata URL: http://localhost2:8081/c/portal/saml/metadata
- Name Identifier Format: Email Address
- Name Identifier Attribute Name: emailAddress
Set up the Identity Provider:
- Visit http://localhost:8081/
- Go to the Control Panel → Instance Settings → Instance Configuration → General tab
- Set name to Service Provider
- Set Virtual Host to localhost2
- Go to Control Panel → SAML Admin → General
- SAML Role: Identity Provider
- Entity ID : idp
- Click on Save
- Check Enabled
- Click on Save
Set up the Service Provider Connection:
- Go to Control Panel → SAML Admin → Service Provider Connections
- Click on Add Service Provider
- On the New Service Provider window
- Name: Service Provider
- Select Enabled
- Entity Id: sp
- Choose connect to metadata URL option
- Meta data URL: http://localhost:8080/c/portal/saml/metadata
- Name Identifier Format: Email Address
- Name Identifier Attribute Name: emailAddress
Usage:
- Visit http://localhost:8080/
- Click on Sign In
- You are redirected to the Identity Provider
- Sing in with your credentials
- You are redirected to the Service Provider