Skip to main content
Participant
January 22, 2025
Question

Adobe Sign refresh token Issue - getting error The underlying connection was closed

  • January 22, 2025
  • 1 reply
  • 227 views

Hello All,

 

I am using the developer account and trying to get access token using refresh token but getting underlying connection close error -

below is the code we are trying -

string requestURI = "https://secure.in1.adobesign.com/oauth/v2/refresh";
string refreshToken = refresh token;

var requestBody = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("client_id", Client id),
new KeyValuePair<string, string>("client_secret", client_secret),
new KeyValuePair<string, string>("grant_type", "refresh_token"),
new KeyValuePair<string, string>("refresh_token", refreshToken),
};
using (var httpClient = new HttpClient())
{
HttpContent requestContent = new FormUrlEncodedContent(requestBody);

httpClient.DefaultRequestHeaders.Clear();

var httpResponse = httpClient.PostAsync(requestURI, requestContent).Result;
var response = httpResponse.Content.ReadAsStringAsync().Result;
}

below is the error details -
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---

Any pointer will be really helpfull.
Thank you.

1 reply

Meenakshi_Negi
Legend
January 24, 2025

Hi ajay_9690,

 

Thank you for reaching out,

 

As you are using the Acrobat Sign Developer service and have questions, the experts can best answer them. Moving this thread to the Acrobat Sign Developer board for visibility.

With the developer account, you may also contact the pre-sales team. They will be able to provide you the pre-sales technical assistance and share the correct information.
Please refer to the following link to contact them: https://adobe.ly/4htmXXk. You may use the Contact Us button for Adobe Sign Solutions under the team tab.

 

Thanks,

Meenakshi