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, add the required role directly as follows:
- Add your custom Sitecore role (for example, CustomPublishingRole) as a member to the Publishing Service Administrator role.
- Add the CustomPublishingRole role to the allowedPublishRoles and allowedFullPublishRoles nodes of the Sitecore.Publishing.Service.config file.
- Assign the CustomPublishingRole role to a Sitecore user.