Invalid API key

In this article
Applies to

This issue occurs in pre-4.1.414.9 versions of Coveo for Sitecore. It may also occur if your integration is still using API keys created with hardcoded privileges rather than ones linked to a Coveo for Sitecore API key template.

Symptoms

The Coveo for Sitecore integration may become unable to create API keys automatically. Existing functionality provided by the Coveo Platform may also stop working. Potential symptoms include:

  • Inability to index Sitecore field content or complete loss of indexing.

  • Loss of search functionality.

Cause

Earlier Coveo for Sitecore packages created API keys using hardcoded sets of Coveo Platform privileges. Over time, some of these privileges were split, others were deprecated, and overly permissive sets were reduced to adhere to the principle of least privilege. Coveo maintained backward compatibility for legacy Coveo for Sitecore versions through dedicated code that ran at API key creation time. This code has been removed.

As a result, API keys used by legacy versions of Coveo for Sitecore may contain invalid privilege combinations. Automatic API key creation on these versions may also fail or produce keys that lack the privileges required for full functionality.

More recent versions of Coveo for Sitecore create API keys using privilege templates instead of hardcoded privileges, ensuring that API key privileges stay up to date automatically.

Resolution

Upgrade from your version to the latest release of Coveo for Sitecore.

Upgrading regenerates your API keys using templates and restores full Coveo support for your organization.

Workaround

Important

This workaround is provided as-is and Coveo hasn’t validated it with the affected (and no longer supported) versions of Coveo for Sitecore. It requires version 4.1.286.9 or later because only those versions of Coveo for Sitecore 4.1 contain the necessary configuration features.

This workaround doesn’t restore Coveo support for your organization. For a fully supported path, see the recommended solution.

  1. Create the two API keys using the SitecoreCloudSearch and SitecoreCloudConfiguration templates.

  2. Reconfigure Coveo for Sitecore by using the REST API bundled with Coveo for Sitecore or the PowerShell script.