Asking Allah for one of the “miracles” of the awliya’ (“saints”)
Question

It is well known that the awliya’ (close friends, sometimes translated as “saints”) of Allah are those pious believers who truly fear Allah. It is also well known that there are some of the awliya’ who do not possess tangible miracles (karaamah) and others to whom Allah gives miracles. But I want to ask whether there is anything wrong with asking for a miracle directly from Allah, even though I know that steadfastness is better and dearer to Allah. But the hoped-for aim is to increase faith and do good by means of that miracle and to spread da’wah, as well as righteous deeds of course, whilst paying attention to concealing that miracle. I reiterate and affirm that I know that steadfastness is better. 
Is this du’a’ regarded as one of the supplications that are forbidden and impossible? Does Allah get angry with this? I mean, is it regarded as overstepping the mark in supplication? And what is the ruling on one who seeks out the times when supplications are answered and strives hard so that Allah will answer his prayer? In brief, is it permissible to offer such a du’aa’?.
Praise be to Allah.We do not see anything wrong with the Muslim asking Allah to honour him with that with which He honoured His close friends (awliya’) with extraordinary things or miracles. This is for a number of reasons: 
1.There is no report of any prohibition on doing so.
2.It is not impossible for miracles to happen for a believer; rather there are many cases in which Allah, may He be glorified and exalted, honoured His slaves with them, and He may grant miracles to whomever He wants. If a person asks his Lord for that, he will not be asking for something that is impermissible and he is not asking for something impossible, because it is not difficult for Allah.
3.The hadeeth about the three men who were trapped in the cave by a rock, and each of them prayed by virtue of his righteous deeds for Allah to move the rock for them, and He moved it for them. This is an example of asking Allah for a true miracle, because moving a huge rock without any effort on the part of people can only happen by way of a miracle. The hadeeth was narrated by al-Bukhaari (2272) and Muslim (2743).
4.A similar report is the hadeeth about the man who put money in a wooden box and then threw it into the sea, and he asked Allah to make it reach its rightful owner from whom he had borrowed it. The hadeeth was narrated by al-Bukhaari in a mu’allaq majzoom report, (2291).
5.al-Laalkaa’i referred in Karaamaat al-Awliya’ to a number of miracles that happened to the righteous after they asked Allah, may He be glorified and exalted, for them, such as the du’aa’ of al-‘Ala’ ibn al-Hadrami who said: O Most Forbearing, O All Knowing, O Most High, O Almighty, give us rain (p. 150), and on another occasion he offered a similar du’aa’ so that he army could walk across the river. And there are many other similar stories
All of this is evidence which indicates that in principle it is permissible to ask Allah for extraordinary events in the form of miracles. 
But we should point out to the one who wants to offer such a prayer a number of important things which should not be ignored: 
1.First of all, the one who wants to pray for a miracle should intend first and foremost to ask Allah to make him one of His close friends and he should seek to draw close to Him, so that Allah will not withhold from him what he is seeking and will honour him with what he is asking for.
2.His intention should be sincerely for the sake of Allah, and he should not intend thereby to boast or show off or compete with others. Rather he should seek the closest of status to Allah and the dearest of status to Him, so he should ask Allah for that which is permissible for him, which is karaamah. As for mu’jizah, that is only permissible for the Prophets.
3.There should be a valid need to ask for this, such as one who asks Allah for a child even though he is advanced in years, or he asks Him for rain and for an end to drought and dryness in the land. As for asking Him for miracles for fun or asking for extraordinary things that will not benefit anyone in religious or worldly terms, it is not permissible to ask for that.
Imam al-Quraafi said: One of the haram actions which do not constitute kufr is asking Allah for things that are ordinarily impossible, unless one is a Prophet, because what is the norm for the Prophets (peace be upon them) is the extraordinary, so it is permissible for them to ask for that, as they asked for the table to come down from heaven and for the camel to come out of a solid rock. For one who is a wali (close friend of Allah) and usually has these miracles (karaamaat), then it is permissible for him to carry on with that, in the case of these two categories of people, it is not regarded as poor etiquette. 
A third category is the person who is not a wali but he asks for a miracle, and the meaning behind his asking for that is that so Allah might make him a wali who is close to Him, so that he will deserve these miracles. 
For these three types of people it is not haram. 
As for that which is haram, it includes for example, asking Allah to make one have no need of breathing air so that he can be sure that he will not be suffocated. The norm indicates that this is impossible. Other examples include asking Allah for a child without having intercourse or for fruits and crops without trees and plants. The norm indicates that this is impossible, so the one who asks for that is showing poor etiquette towards Allah, may He be exalted. End quote. 
The author (may Allah have mercy on him) spoke at length and in great detail about some points and reservations surrounding this issue. But we have quoted here what we need concerning this matter. 
Anwaar al-Burooq fi Anwaa’ al-Furooq, 4/268 
And Allah knows best.