From cf57b6c20ac2fa5be006425db74d87f2f9a1907d Mon Sep 17 00:00:00 2001 From: Stephan-Hoffmann <52668775+Stephan-Hoffmann@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:41:38 +0200 Subject: [PATCH] Improve refresh token management in AuthenticationClient Update handling of refresh token in authentication response. When refresh token rotation is enabled make sure to return the new refresh token. #94 --- src/NetCoreForce.Client/AuthenticationClient.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NetCoreForce.Client/AuthenticationClient.cs b/src/NetCoreForce.Client/AuthenticationClient.cs index 3f1a1da..636056b 100644 --- a/src/NetCoreForce.Client/AuthenticationClient.cs +++ b/src/NetCoreForce.Client/AuthenticationClient.cs @@ -301,7 +301,9 @@ public async Task TokenRefreshAsync(string refreshToken, string clientId, string if (responseMessage.IsSuccessStatusCode) { this.AccessInfo = JsonConvert.DeserializeObject(response); - this.AccessInfo.RefreshToken = refreshToken; //not included in reponse + + //with refresh token rotation we get a new refresh token after exchanging the current one. + if (string.IsNullOrEmpty(this.AccessInfo.RefreshToken)) this.AccessInfo.RefreshToken = refreshToken; //when not included in response } else { @@ -368,4 +370,4 @@ public void Dispose() _httpClient.Dispose(); } } -} \ No newline at end of file +}