The Service app is based on Jmix 1.6 and exposes Customer entity through the Generic REST.
The Client app is based on Jmix 2.5 and consumes the Service's Customer data using REST DataStore.
- Open the
client-appandservice-appfolders as separate projects in the IDE. Due to different Jmix versions they cannot work in a single composite project. - Run the
service-appapplication. - Open
http://localhost:8081/in your browser, login asadmin/admin. - Create a new User with the
integrationname andintegrationpassword. Assign theIntegrationRoleto this user. - Run the
client-appapplication. - Open
http://localhost:8080/in your browser, login asadmin/admin. - Now you can manage Customers and Regions both in the Client and in the Service applications.
-
Jmix 1.x REST API supports only the Password grant, so the Client authenticates in the Service as a special "integration user". This user must be created in the Service with minimal permissions required for the integration.
-
The Client app uses the standard
restds_RestPasswordAuthenticator, but customRestTokenHolderimplementation that stores the token of the integration user: IntegrationTokenHolder. All Service invocations use the same token. -
The IntegrationInitializer class authenticates in the Service on the Client application start using the "integration user" credentials obtained from the environment.
-
Jmix 1.x uses non-standard path for obtaining tokens, so the Client includes the following property:
serviceapp.tokenPath=/oauth/token -
The
jmix.restds.authentication-provider-storeproperty that provides authentication of the current user in the service must not be present the environment. -
Jmix 1.x REST API does not support inline fetch plans. Therefore, the Service and the Client define the same
customer-with-regionfetch plan in their fetch-plans.xml files. This fetch plan's name is used in the Client views for theCustomerentity.