I have read this in the Holy Gospel: the trial and temptation of Jesus by Satan.
This temptation and trial is for every apostle: at the start of his mission when he is tasked with his duty; i.e. when the apostlehood is imposed on him and he is selected by God for this work.
This is in the Quran 22: 52
وَمَا أَرْسَلْنَا مِن قَبْلِكَ مِن رَّسُولٍ وَلَا نَبِيٍّ إِلَّا إِذَا تَمَنَّى أَلْقَى الشَّيْطَانُ فِي أُمْنِيَّتِهِ فَيَنسَخُ اللَّهُ مَا يُلْقِي الشَّيْطَانُ ثُمَّ يُحْكِمُ اللَّهُ آيَاتِهِ وَاللَّهُ عَلِيمٌ حَكِيمٌ
The explanation:
(Never did We send any apostle or prophet before you [Mohammed] unless he wished [to be a messenger],
the Devil proposed [difficulties that would face] his desired [mission],
but God would abolish what the Devil would propose then God would establish His signs,
and God is All-Knowing, Most Wise.)
But Satan usually gives false promises and stir in them false wishes and desires; he may even swear to them falsely, as did he swear to Adam and Eve that the forbidden tree was very good to eat of its fruit.
This is in the Quran 4: 120
يَعِدُهُمْ وَيُمَنِّيهِمْ وَمَا يَعِدُهُمُ الشَّيْطَانُ إِلاَّ غُرُورًا
The explanation:
([Satan] promises them, and fills them with vain fancies; but there is nothing Satan promises them except delusion.)
So Satan said he will give him the kingdoms of the earth; but Jesus knew this was not true; because all that is by the hand of God: He gives the sovereignty to whomever He pleases and He takes it from whomsoever He wills.
Satan promises them and let them have false wishes and desires, and many people think that by following the suggestion of Satan, they will prosper; and that if they expend of their wealth on the poor and needy for the sake of God alone – Satan let them imagine that they will be impoverished; while God promises them that He will enrich them when they expend the alms for the sake of God alone.
At last Satan will quit himself of them:
This is in the Quran 14: 22
وَقَالَ الشَّيْطَانُ لَمَّا قُضِيَ الأَمْرُ إِنَّ اللّهَ وَعَدَكُمْ وَعْدَ الْحَقِّ وَوَعَدتُّكُمْ فَأَخْلَفْتُكُمْ وَمَا كَانَ لِيَ عَلَيْكُم مِّن سُلْطَانٍ إِلاَّ أَن دَعَوْتُكُمْ فَاسْتَجَبْتُمْ لِي ..الخ
The explanation:
(And Satan [will] say when the matter [will] have been over:
"God [surely] promised you a promise of truth, but I promised you then I deviated you [from the truth];
even I had no authority over you but that I invited you and you responded to me;
so don't blame me but blame yourselves;
[for] I cannot save you nor can you save me;
I deny your former act of associating me [with God];
there awaits wrong-doers a painful torment.)