Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, September 14, 2023

Authentication failed because the remote party has closed the transport stream

Sitecore Content Hub is a powerful tool for managing digital assets and content. When it comes to integrating Content Hub with your Sitecore instance, you may encounter some weird challenges. One of the issues that users may face is the "Authentication failed because the remote party has closed the transport stream" error. In this article, we will explore the causes of this error and how to resolve it.

 

The Scenario

Imagine you have a Sitecore instance running on Azure PaaS, and you've installed the Content Hub connector. Everything seems to be working smoothly – you can retrieve images and links from the Digital Asset Management (DAM) system and display them in Image and Rich Text fields. However, trouble arises when you attempt to use the "Insert DAM link" feature within the General Link field. Instead of successfully inserting a link, you encounter the perplexing "Authentication failed" error.

 

General link field error for Sitecore Content Hub
General link field error for Sitecore Content Hub

Initial Troubleshooting

Naturally, our first instinct is to check our credentials. We've logged into Content Hub in another browser tab, and there don't seem to be any issues with authentication for Image and Rich Text fields. The problem only arises when interacting with the General Link field as

 

Checking internal code

Digging deeper into the issue, we examine the code responsible for communicating with the Content Hub API. This line of code is executed exclusively when we use the "Insert DAM link" command within the General Link field which basically retrieves additional properties.

value = GetAdditionalPropertyValue(chKey, DAMHelper.GetEntity(long.Parse(result[Constants.SelectedAssetId])));

 

Suspecting TLS Issue

At this point, we might suspect a Transport Layer Security (TLS) issue, as TLS configuration can sometimes lead to connectivity problems. However, we verify that our development environment is configured to use TLS 1.2, eliminating TLS as the root cause.

 

Azure VNET to the Rescue

With conventional troubleshooting avenues exhausted, we turn our attention to our Azure Virtual Network (VNET) configuration. After reviewing our VNET traffic rules, we discover the key to resolving the issue. We open up the traffic for the Sitecore Content Hub URL at the Azure VNET level.

 

The Solution

To our relief, this Azure VNET setting proves to be the missing piece of the puzzle. Once we've made the necessary adjustments, the "Authentication failed" error becomes a thing of the past. The General Link field now functions seamlessly, and we can insert DAM links without encountering any connectivity problems.

 

Finally

Troubleshooting errors like "Authentication failed because the remote party has closed the transport stream" can be a complex process. It often requires a systematic approach to identify the root cause and find a solution. In this case, a careful examination of the code, consideration of TLS configurations, and ultimately, the adjustment of Azure VNET settings, resolved the issue.

By sharing this experience, we hope to assist others who may encounter similar challenges when using Sitecore Content Hub connectors. Remember that troubleshooting can be a learning opportunity, and persistence often leads to a successful resolution.

Monday, September 4, 2023

Troubleshooting Sitecore Content Hub Connector Authentication Issue with General Link Fields

Sitecore Content Hub Connector is a powerful tool that enables seamless integration between Sitecore and Content Hub. This integration allows content authors to easily access and manage digital assets from Content Hub within Sitecore. However, like any integration, it can encounter occasional issues. In this blog post, we'll discuss a specific problem some users have faced: an authentication error when working with General Link fields in Sitecore.

 

The Scenario:

You've set up Sitecore 10.3 on Azure PaaS and successfully integrated it with Sitecore Content Hub using PowerShell installation script. Everything seems to be working fine like RichText and Image field able to get images from Content Hub successfully. But while using the "Insert DAM Link" option within a General Link field, you encounter an error message that says, "Unable to authorize with the specified credentials."

 

authentication error
Authentication error

Troubleshooting the Issue:

Let's walk through the steps to diagnose and resolve it.

Review Connection String:

The actual Content Hub user password is "123456789$ASDfghjkl", but when I checked connection string, I notice that the password for the Content Hub user is truncated, like "123456789$". This "$" sign in the password can be the root cause of the problem.

Password Correction:

To resolve this issue, simply correct the password in your connectionstring.config. Change it to "123456789$ASDfghjkl " or whatever your actual password is without the "$" sign.

Root Cause:

PowerShell script have a problem with "$" sign. PowerShell script can truncate your password and update your ConnectionStrings.config file with wrong password. So need to update connectionstring.config file manually with correct and full password.

Testing:

After making this correction, test the "Insert DAM Link" functionality in the General Link field again. You should no longer encounter the authentication error.

Lessons Learned:

Never keep $ sign in password while installing and running Powershell scripts for installing Sitecore Content Hub Connector.