I have a custom SPE script that is executed from the Reporting Tools on the Sitecore start menu. The script writes a csv file to the app_data\temp directory, then calls Get-Item $filePath | Out-Download to download the file.

Recently, I've found that the file is no longer downloading and returning the following error : "Attempt to call the 'handleDownload' service failed as user 'xxxx\Anonymous' was not authorized."

I'm logged in as sitecore\Admin to run the script, so i'm not sure how i'm getting the anonymous user account.

During investigation, as the script completes in the browser while viewing the dev console, it appears to redirect to the login page with a returnUrl parameter in the query string:


The script was originally written in Sitecore 8.x and SPE 4.7. Now running 9.1 and SPE 5.1.

Has anyone experienced this behavior? Or maybe I missed some configuration with the new version. handleDownload is enabled to the default roles.

  • Did you enable the Identity Server configuration file included with SPE? Commented Sep 9, 2019 at 18:29
  • No. Bingo! That was it. Thank you.
    – LCM
    Commented Sep 9, 2019 at 18:41

1 Answer 1


Since you are running Sitecore 9.1 then it's safe to assume Identity Server is running. SPE 5.1 or later includes a configuration file for Identity Server.

This issue came up when some community members were trying to setup SPE on Azure PaaS. You can find the sample patch there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.