1. Configuring Cortex
1. Configuring Cortex
The following configuration files are required forCortex to successfully start up:
- Trust Headers Configurations : authTrustHeader.config and authClientTrustHeader.config
- Recommended Page Size Configurations : recommendationsPageSize.config.
- Authentication End Point Configurations : authClientHost.cfg
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
To set the authentication endpoint trust header:
- In your ep/conf/cortex directory, create a file named authTrustHeader.config.
- 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:
- In your ep/conf/cortex directory, create a file named authClientTrustHeader.config.
- 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:
- In your ep/conf/cortex directory, create a file named recommendationsPageSize.config.
- 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: FormattingThe '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:
- In your ep/conf/cortex directory, create a file named authClientHost.cfg
- In the authClientHost.cfg file, add the following field and define the authentication endpoint URI:
DEFAULT_HOST=http://localhost:9080/cortex/authentication/user