Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) said: I heard the Messenger of Allah (peace and blessings be upon him) say: "Take the stipend as long as it remains a stipend, but when it becomes a bribe in religion, do not take it - yet you will not leave it, for poverty and need will prevent you. Listen! The millstone of Islam is turning, so turn with the Book wherever it turns. Listen! The Book and authority will soon part ways, so do not part from the Book. Listen! Soon there will be rulers over you who will decide for themselves what they will not decide for you; if you disobey them, they will kill you, and if you obey them, they will lead you astray." The Companions said: O Messenger of Allah, what should we do? He (peace and blessings be upon him) said: "As the companions of Isa bin Maryam (peace be upon him) did: they were sawn apart with saws and raised up on wooden beams. Death in obedience to Allah is better than life in disobedience to Allah."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17308