Skip to content

Commit 8a3a813

Browse files
Merge pull request #95 from Stephan-Hoffmann/patch-1
Improve refresh token management in AuthenticationClient
2 parents d7cd3d6 + cf57b6c commit 8a3a813

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/NetCoreForce.Client/AuthenticationClient.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ public async Task TokenRefreshAsync(string refreshToken, string clientId, string
301301
if (responseMessage.IsSuccessStatusCode)
302302
{
303303
this.AccessInfo = JsonConvert.DeserializeObject<AccessTokenResponse>(response);
304-
this.AccessInfo.RefreshToken = refreshToken; //not included in reponse
304+
305+
//with refresh token rotation we get a new refresh token after exchanging the current one.
306+
if (string.IsNullOrEmpty(this.AccessInfo.RefreshToken)) this.AccessInfo.RefreshToken = refreshToken; //when not included in response
305307
}
306308
else
307309
{
@@ -368,4 +370,4 @@ public void Dispose()
368370
_httpClient.Dispose();
369371
}
370372
}
371-
}
373+
}

0 commit comments

Comments
 (0)