Sunan an-Nasa'i, Volume 5, Book 39, Hadith 4155 (DarusSalam) ⓘ
It was narrated that 'Ubadah bin As-Samit said: "We pledged to the Messenger of Allah to hear and obey, both in times of hardship and ease." And he mentioned similarly.
أَخْبَرَنَا عِيسَى بْنُ حَمَّادٍ، قَالَ أَنْبَأَنَا اللَّيْثُ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ عُبَادَةَ بْنِ الْوَلِيدِ بْنِ عُبَادَةَ بْنِ الصَّامِتِ، عَنْ أَبِيهِ، أَنَّ عُبَادَةَ بْنَ الصَّامِتِ، قَالَ بَايَعْنَا رَسُولَ اللَّهِ صلى الله عليه وسلم عَلَى السَّمْعِ وَالطَّاعَةِ فِي الْعُسْرِ وَالْيُسْرِ . وَذَكَرَ مِثْلَهُ .
also referenced under: Hadith 4150 (Reference) & Book 39, Hadith 2 (In-Book)