401 unauthorized error while attempting to publish an item using the Publishing Service

  • Publishing might fail with a 401 unauthorized exception and redirect a user to the login page because the Sitecore Publishing Service (SPS) module is not authorized for users with a custom role. The issue occurs if roles are added as members of other roles. In cases where roles are explicitly added to the user, the publishing succeeds.

  • To resolve the issue, consider one of the following options:

    • Add the required role directly as follows:
      1. Add your custom Sitecore role (for example, CustomPublishingRole) as a member to the Publishing Service Administrator role.
      2. Add the CustomPublishingRole role to the allowedPublishRoles and allowedFullPublishRoles nodes of the Sitecore.Publishing.Service.config file.
      3. Assign the CustomPublishingRole role to a Sitecore user.
    • Download and install the hotfix found on this page: SC Hotfix 362094-1.zip.

      Be aware that the hotfixes were built for specific Sitecore XP versions, and must not be installed on other Sitecore XP versions or in combination with other hotfixes. If you have already installed any other hotfixes on a certain Sitecore XP instance, send a request for a compatibility check to Sitecore Support.
      Note that you must extract the ZIP file contents to locate the installation instructions and related files inside it. You must install the hotfixes on a CM instance and then sync with other instances using the regular development practices.

Applies to:

Publishing Service Module 9.1.0 - 9.2.0

May 01, 2020
May 08, 2020

Reference number:

360559

Keywords: 

  • Publishing