"Could not validate access using the provided credentials" error while configuring an SitecoreAI project


Description

When configuring an SitecoreAI project for running Powershell scripts in SitecoreAI Powershell ISE the following error might appear:

Could not validate access using the provided credentials

Solution

To prevent the error, proceed as follows:

  1. On the tab Home open Manage my Projects.
  2. Click View Project on the selected project.
  3. Click the button Options and choose Environment variables.
  4. On the opened tab set the SITECORE_SPE_ELEVATION value to Allow.
    Note: Only set the SITECORE_SPE_ELEVATION value to Allow for a local environment.
  5. After updating the environment variable, trigger build and deploy again for your SitecoreAI project.

For more details on Environment variables refer to the official Sitecore documentation.