protected virtual bool TryGetValue(
     AzureSqlConnectionStringBuilder connectionString,
     out AccessTokenCacheValue accessToken)
 {
     return(_cache.TryGetValue(connectionString.ConnectionString, out accessToken));
 }
 /// <summary>
 /// Access token is near expiration, and should be refreshed soon.
 /// </summary>
 private bool IsNearExpiry(AccessTokenCacheValue accessToken)
 {
     return(TokenExpiresIn(accessToken.AuthenticationResult, DefaultMinExpirationInMinutes));
 }
 /// <summary>
 /// KeyVault certificate has been rotated, and client assertion and tokens should be refreshed soon. Old certificate
 /// (and tokens) should still be valid, so long as the rotation policy is not set to 100% of certificate lifetime.
 /// </summary>
 private bool ClientCertificateHasChanged(
     AccessTokenCacheValue accessToken,
     string clientCertificateData)
 {
     return(!accessToken.ClientCertificateData.Equals(clientCertificateData, StringComparison.InvariantCulture));
 }
 /// <summary>
 /// Access token has expired, and must be refreshed.
 /// </summary>
 private bool IsExpired(AccessTokenCacheValue accessToken)
 {
     return(TokenExpiresIn(accessToken.AuthenticationResult, expirationInMinutes: 5));
 }