Be mindful of your duty to Allah
Abu Umamah (radi Allahu anhu) said: I heard Messenger of Allah (sal Allahu alaihi wa sallam) during the sermon of the Farewell Pilgrimage saying, “Be mindful of your duty to Allah; perform your five daily Salat, observe Saum during the month (of Ramadan) , pay the Zakat on your properties and obey your leaders; (if you do so) you will enter the Jannah of your Rubb”
The word Wada, means to say farewell. The Farewell Pilgrimage was the last pilgrimage, the Prophet (sal Allahu alaihi wa sallam) performed, and on this occasion he bade farewell to the people and for this reason it came to be known as Hajjat-ul-Wada.
Obedience of the rulers is stressed but it is conditional, that is to say, they are to be obeyed only if their orders are not against the injunctions of Allah. Similarly, their obedience is obligatory till such time that they do not do anything which amounts to open disbelief. If any of these two things occurs, then no obedience would be due to them.
And Allah Knows Best!