Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Please post this question to the Adobe Sign forum. https://community.adobe.com/t5/adobe-acrobat-sign/ct-p/ct-adobe-sign