Mishkat al-Masabih
Mishkat al-Masabih 3666
وَعَنْ عُبَادَةَ بْنِ الصَّامِتِ قَالَ: بَايَعْنَا رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَلَى السَّمْعِ وَالطَّاعَةِ فِي الْعُسْرِ وَالْيُسْرِ وَالْمَنْشَطِ وَالْمَكْرَهِ وَعَلَى أَثَرَةٍ عَلَيْنَا وَعَلَى أَنْ لَا نُنَازِعَ الْأَمْرَ أَهْلَهُ وَعَلَى أَنْ نَقُولَ بِالْحَقِّ أَيْنَمَا كُنَّا لَا نَخَافُ فِي اللَّهِ لَوْمَةَ لَائِمٍ. وَفِي رِوَايَةٍ: وَعَلَى أَنْ لَا نُنَازِعَ الْأَمْرَ أَهْلَهُ إِلَّا أَنْ تَرَوْا كُفْرًا بَوَاحًا عِنْدَكُمْ مِنَ اللَّهِ فِيهِ بُرْهَانٌ
Ubada ibn al-Samit reported: We pledged allegiance to the Messenger of God to listen and obey in hardship and ease, in what we liked and disliked, and even when others were given preference over us; not to dispute authority with those entitled to it; and to speak the truth wherever we were, fearing no reproach concerning God. In one version: We pledged not to dispute authority with those entitled to it unless you see clear unbelief for which you have proof from God.
Translation notes
The second pledge wording is explicitly marked as a variant and includes the condition of clear unbelief accompanied by proof from God.