Issue
This article documents how to generate a SAML metadata XML file that also has HTTPS enabled.
Environment
- Liferay Portal 6.2, DXP 7.0, DXP 7.1
- Any web server
Resolution
In order to generate a SAML metadata.xml file that has HTTPS enabled, the following steps are necessary:
- Generate a Java
.keystorefile so that the application server can run on a secure port with the appropriate Java security certificate. - In the application server, enable the application server's secure ports, which is usually 8443 but could be 9443 depending on the app server's default configuration.
- If using a web server, you must enter the following in the
portal-ext.properties:web.server.protocol=https. This ensures that the web server directs all traffic to go to the HTTPS enabled site. - Once the application has started, navigate to
https://{yourhostname}:*443. (For example, https://localhost:8443). Accept any security warnings in case the browser does not recognize that the security certificate as valid. - Follow the steps to configure Liferay DXP's SAML in Control Panel and then enable the instance as either an IdP or SP. The linked article is for DXP 7.0.
- Enter the following to generate the
metadata.xmlfile:https://{yourhostname}:*443/c/portal/saml/metadata(for example:https://localhost:8443/c/portal/saml/metadata. - When exporting the file, you should see all the URLs with HTTPS enabled.