Jamming attacks are becoming increasingly common and pose a significant threat to the security and reliability of wireless sensor networks (WSNs). These attacks can be difficult to detect, as they often operate in a stealthy manner, disrupting communication between sensors. Artificial intelligence (AI) techniques have the potential to be highly effective in detecting jamming attacks. However, the adoption of AI-based techniques for detecting jamming attacks has been limited due to the scarcity of up-to-date and accurate data of these attacks. Privacy-aware collaboration among agents is expected to be essential in building robust AI-based models for detecting jamming attacks in WSNs. In this context, we propose a novel framework that uses collaborative federated learning (FL) to enable privacy-aware distributed learning among multiple agents without sharing their sensitive data. This can be particularly important in jamming attack detection, where data may contain sensitive information that should not be shared. In addition, we design a novel secure aggregation scheme to protect the FL aggregation service from reverse-engineering attacks. The effectiveness of our proposed framework was tested using the public Wireless Sensor Networks Dataset (WSN-DS) that includes four types of well-known jamming attacks (i.e., constant jamming, reactive jamming, random jamming, and deceptive jamming). The results of a thorough experiment using the WSN-DS data set demonstrate the effectiveness and high accuracy/F1-score (99%) in detecting jamming attacks while also maintaining participant privacy.