Overview This guide walks through creating two OSGi modules in Liferay 7.4 and sharing a Java package between them using the standard API + Implementation pattern. This is the most common and correct approach for exposing reusable services in a Liferay-based architecture. In OSGi, a bundle (module) does not expose its internal packages by default — everything is private unless explicitly exported. To share code between modules, the standard practice is to split functionality into: · An API module — contains interfaces/DTOs and exports the package · A Service (Implementation) module — implements the interface, imports the package, and registers the implementation as an OSGi component/service The consuming module then simply imports the API package and looks up the service using @Reference injection. Step 1: Create the API Module Using Liferay Workspace + Blade CLI, generate a new API module: blade create -t api -p com.sgc.greeting greeting-api This generates a Gradle module unde...
1. Configure Keycloak 15 as the Identity Provider (IdP) Liferay 7.4 Keycloak will manage your users and issue SAML assertions. · Create a SAML Client : 1. Log in to the Keycloak Admin Console and go to Clients > Create . 2. Client ID : Use a unique identifier (e.g., liferay-saml-sp ). 3. Client Protocol : Select saml . 4. Client SAML Endpoint : Use Liferay's ACS URL: https://[your-domain]/c/portal/saml/acs . · Adjust Client Settings : 1. Valid Redirect URIs : Set to https://[your-domain]/* . 2. Name ID Format : Set to email or username based on your Liferay user mapping. 3. Force Name ID Format : Set to On . 4. Client Signature Required : Set to Off for initi...