0

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:

"/login?ReturnUrl=%2f-%2fscript%2fhandle%2fAA8204B5D76D425A850C69B12D6CFE38"

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? – Michael West Sep 9 at 18:29
  • No. Bingo! That was it. Thank you. – LCM Sep 9 at 18:41
3

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, privacy policy and cookie policy

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