private static void RefreshAccessToken() { if (AccessTokenService.RefreshTokenExpired || AccessTokenService.RequestedAccessToken == DateTime.MinValue || string.IsNullOrEmpty(AccessTokenService.AccessToken)) { var success = AccessTokenService.GetAccessToken("SDL_PLUGIN", "E9KWtWahXs4hvE9z"); if (!success) { Logger.Error(PluginResources.TermSearchService_Error_in_requesting_access_token); } } else if (AccessTokenService.AccessTokenExpired && !AccessTokenService.AccessTokenExtended) { var success = AccessTokenService.ExtendAccessToken(); if (!success) { Logger.Error(PluginResources.TermSearchService_Error_in_refreshing_access_token); } } }