Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. The Developer Center continues to support Commerce 6.13.0 through 7.4.1.Visit new site

1. Configuring Cortex

1. Configuring Cortex

Cortex needs the following configuration files to successfully start up:
  • Trust Headers Configurations : authTrustHeader.config and authClientTrustHeader.config
  • Recommended Page Size Configurations : recommendationsPageSize.config.
  • Authentication End Point Configurations : authClientHost.cfg
Follow the instructions below describe how create the Cortex configuration directory and define the required configuration files.

1. Create the Cortex Configuration Directory

To create the Cortex Configuration Directory:

  • Create the following directory:
    • For Windows: C:/etc/ep/cortex/system/config
    • For Linux: /etc/ep/cortex/system/config

2. Configuring Trust Headers

Cortex requires a confidential key, a trust header, to communicate with its OAuth2 endpoint; otherwise, communications with Cortex will fail. To configure this trust header, you need to create two configuration files:
  • authTrustHeader.config
  • authClientTrustHeader.config
Create these files following the instructions below.

To set the authentication endpoint trust header:

  1. In your C:/etc/ep/cortex/system/config directory, create a file named authTrustHeader.config.
  2. In authTrustHeader.config, add the following fields and define your trust header field value:
    relos.trust.header.field.VALUE="<secret trust header>"
    relos.trust.header.field.NAME="x-ep-trust-header"

To set the OAuth2 endpoint trust header:

  1. In your C:/etc/ep/cortex/system/config directory, create a file named authClientTrustHeader.config.
  2. In authClientTrustHeader.config, add the following fields and define your trust header field value:
    relos.trust.header.field.VALUE="<secret trust header>"
    relos.trust.header.field.NAME="x-ep-trust-header"

3. Configuring Recommendations Page Size

Cortex requires a page size to set the pagination for recommendations. Since a large number of recommended items may be available, the page size will limit the number of items retrieved per request.

To set the recommendations page size:

  1. In your C:/etc/ep/cortex/system/config directory, create a file named recommendationsPageSize.config.
  2. In recommendationsPageSize.config, add the following field and define your page size value:
    rest.recommendations.page.size.VALUE=I"<positive integer>"
    Example with 5 items per page:
    rest.recommendations.page.size.VALUE=I"5"
    Note: Formatting

    The 'I' is required as it indicates the value is an integer.

4. Configuring Authentication Endpoint

You must configure the Cortex authentication endpoint or else PUBLIC and REGISTERED users cannot authenticate. To configure the authentication endpoint, create and configure the authClientHost.cfg file following the instructions below.

To create the authClientHost.cfg file:
  1. In your C:/etc/ep/cortex/system/config directory, create a file named authClientHost.cfg
  2. In the authClientHost.cfg file, add the following field and define the authentication endpoint URI:
    DEFAULT_HOST=http://localhost:9080/cortex/authentication/user