The question is relating to the interecession of a living or a deceased person, or deeds or the names of Allah. This act is called Tawassul. The method of Tawassul is accepted by all our pious predecessors. However, if acts such as prostration etc are done at a saint’s grave then this is totally wrong and should not be tolerated.
The explanation is indeed a long one and is best addressed by Sheikh Nuh in His reliance as follows;
From Reliance of the Traveller
by Sheikh Nuh Ha Mim Keller
Supplicating Allah by means of an intermediary, whether it be a living person, dead person, a good deed, or a name or Attribute of Allah Most High. The scholar, YUSUF RIFA’I, says: I here want to convey the position, attested to by compelling legal evidence, of the orthodox majority of Sunni Muslims on the subject of supplicating Allah through an intermediary (tawassul), and so I say (and Allah alone gives success) that since there is no disagreement among scholars that supplicating Allah through an intermediary is in principle legally valid, the discussion of its details merely concerns derived rulings that involve interschool differences, unrelated to questions of belief or unbelief, monotheism or associating partners with Allah (shirk); the sphere of the question being limited to permissibility or impermissibility, and its ruling being that it is either lawful or unlawful. There is no difference among groups of Muslims in their consensus on the permissibility of three types of supplicating Allah through an intermediary (tawassul):
(1) TAWASSUL through a living righteous person to Allah Most High, as in the hadith of the blind man with the Prophet (Allah bless him and grant him peace) as we shall explain;
(2) The TAWASSUL of a living person to Allah Most High through his own good deeds, as in the hadith of the three people trapped in a cave by a great stone, a hadith related by Imam Bukhari in his “Sahih;”
(3) And the TAWASSUL of a person to Allah Most High through His entity (dhat), names, attributes, and so forth.
Since the legality of these types is agreed upon, there is no reason to set forth the evidence for them. The only area of disagreement is supplicating Allah (tawassul) through a righteous dead person. The majority of the orthodox Sunni Community hold that it is lawful, and have supporting hadith evidence , of which we will content ourselves with the Hadith of the Blind Man, since it is the central pivot upon which the discussion turns.
Tirmidhi relates, through his chain of narrators from ‘Uthman ibn Hunayf, that a blind man came to the Prophet (Allah bless him and give him peace) and said, “I’ve been afflicted in my eyesight, so please pray to Allah for me.” The Prophet (Allah bless him and grant him peace) said: “Go make ablution (wudu), perform two rak’as of prayer, and then say:
“Oh Allah, I ask You and turn to You through my Prophet Muhammad, the Prophet of mercy; O Muhammad (Ya Muhammad), I seek your intercession with my Lord for the return of my eyesight [and in another version: “for my need, that it may be fulfilled. O Allah, grant him intercession for me”].” The Prophet (Allah bless him and give him peace) added, “And if there is some need, do the same.”
Scholars of Sacred Law infer from this hadith the recommended character of the “prayer of need,” in which someone in need of something from Allah Most High performs such a prayer and then turns to Allah with this supplication together with other suitable supplications, traditional or otherwise, according to the need and how the person feels. The express content of the hadith proves the legal validity of “tawassul” through a living person (as the Prophet – peace be upon him – was alive at that time). It implicitly proves the validity of tawassul through a deceased one as well, since tawassul through a living or dead person is not through a physical body or through or through a life or death, but rather through the positive meaning (ma’na tayyib) attached to the person in both life and death. The body is but the vehicle that carries that significance, which requires that the person be respected whether dead or alive; for the words “O Muhammad” are an address to someone physically absent – in which state the living and dead are alike – an address to the meaning, dear to Allah, that is connected with his spirit, a meaning that is the ground of “tawassul,” be it through a living or dead person.
Moreover, Tabarani, in his “al-Mu’jam al saghir,” reports a hadith from ‘Uthman ibn Hunayf that a man repeatedly visited Uthman ibn Affan (Allah be pleased with him) concerning something he needed, but Uthman paid no attention to him or his need. The man met Ibn Hunayf and complained to him about the matter – this being after the death (wisal) of the Prophet (Allah bless him and give him peace) and after the caliphates of Abu Bakr and Umar – so Uthman ibn Hunayf, who was one of the Companions who collected hadiths and was learned in the religion of Allah, said: “Go to the place of ablution and perform ablution (wudu), then come to the mosque, perform two rak’as of prayer therein, and say:
‘O Allah, I ask You and turn to You through our Prophet Muhammad, the Prophet of mercy; O Muhammad (Ya Muhammad), I turn through you to my Lord, that He may fulfill my need,’ and mention your need. Then come so that I can go with you [to the caliph Uthman].” So the man left and did as he had been told, then went to the door of Uthman ibn Affan (Allah be pleased with him), and the doorman came, took him by the hand, brought him to Uthman ibn Affan, and seated him next to him on a cushion. ‘Uthman asked, “What do you need?” and the man mentioned what he wanted, and Uthman accomplished it for him, then he said, “I hadn’t remembered your need until just now,” adding, “Whenever you need something, just mention it.” Then, the man departed, met Uthman ibn Hunayf, and said to him, “May Allah reward you! He didn’t see to my need or pay any attention to me until you spoke with him.” Uthman ibn Hunayf replied, “By Allah, I didn’t speak to him, but I have seen a blind man come to the Messenger of Allah (Allah bless him and give him peace) and complain to him of the loss of his eyesight. The Prophet (Allah bless him and give him peace) said, “Can you not bear it?’ and the man replied, ‘O Messenger of Allah, I do not have anyone to lead me around, and it is a great hardship for me.’ The Prophet (Allah bless him and grant him peace) told him, ‘Go to the place of ablution and perform ablution (wudu), then pray two rak’as of prayer and make the supplications.'” Ibn Hunayf went on, “By Allah, we didn’t part company or speak long before the man returned to us as if nothing had ever been wrong with him.” This is an explicit, unequivocal text from a prophetic Companion proving the legal validity of tawassul through the dead. The account has been classified as rigorously authenticated (SAHIH) by Baihaqi, Mundhiri, and Haythami.
Tirmidhi has stated that the hadith of the blind man is “a hadith that is well or rigorously authenticated but singular, being unknown except through his chain of narrators, from the hadith of Abu Ja’far, who is not Abu Ja’far Khatmi,” which means that the narrators of this hadith, despite Abu Ja’far being unknown to Tirmidhi, were acceptable to the degree of being well or rigorously authenticated in either case.
But scholars before Tirmidhi established that Abu Ja’far, this person unknown to Tirmidhi, was Abu Ja’far Khatmi himself. Ibn Abi Khaythama said: “The name of this Abu Ja’far, whom Hammad ibn Salama relates from, is ‘Umayr ibn Yazid, and is the Abu Ja’far that Shu’ba relates from,” and then he related the hadith by the channel of transmission of ‘Uthman from Shu’ba from Abu Ja’far.
Ibn Taymiya, after relating the hadith of Tirmidhi, said: “All scholars say that he is Abu Ja’far Khatmi, and this is correct.”
Reflect on this.
The hadith master, Ibn Hajar, notes in “Taqrib al-tahdhib” that he is Khatmi, and that he is reliable (saduq).
Ibn ‘Abd al-Barr likewise says that he is Khatmi, in “al-Istii’ab fi ma’rifa al-ashab.” Moreover, Baihaqi related the hadith by way of Hakim and confirmed that it was rigorously authenticated (SAHIH), Hakim having related it by a chain of transmission meeting the standards of Bukhari and Muslim, which the hadith master Dhahabi confirmed, and Shawkani cited as evidence. Dhahabi and Shawkani, who are they? The meaning of this is that all the men of the hadith’s chain of transmission are known to top Imams of hadith such as Dhahabi (and who is severer than he?), Ibn Hajar (and who is more precise, learned, or painstaking than he?), Hakim, Baihaqi, Tabarani, Ibn ‘Abd al-Barr, Shawkani, and even Ibn Taymiya.
This hadith was recorded was recorded by Bukhari in his “al-Tarikh al-kabir”, by Ibn Majah in his “Sunan”, where he said it was rigorously authenticated (SAHIH), by Nasa’i in “Amal al-yawm wa al-layla”, by Abu Nu’aym in “Ma’rifa al-Sahaba”, by Baihaqi in “Dala’il al-nubuwwa”, by Mundhiri in “al-Targhib wa al-tahrib”, by Haythami in “Majma’ al zawa’id wa manba’ al-fawa’id”, by Tabarani in “al-Mu’jam al-kabir”, by Ibn Khuzayma in his “Sahih”, and by others. Nearly 15 hadith masters (“huffaz”, hadith authorities with more than 100,000 hadiths and their chains of transmission by memory) have explicitly stated that this hadith is rigorously authenticated (sahih). As mentioned above, it has come with a chain of transmission meeting the standards of Bukhari and Muslim, so there is nothing left for a critic to attack or slanderer to disparage concerning the authenticity of the hadith. Consequently, as for the permissibility of supplicating Allah (tawassul) through either a living or dead person, it follows by human reason, scholarship, and sentiment, that there is flexibility in the matter. Whoever wants to can either take tawassul or leave it, without causing trouble or making accusations, since it has been this thoroughly checked (“Adilla Ahl al-Sunna wa al-Jama’a , 79-83).
It is well to review some salient features of the proof that was given , such as:
(1) that there are 2 hadiths, Tirmidhi’s hadith of the “blind man” and Tabarani’s hadith of the “man in need” to whom Uthman ibn Hunayf related the story of the blind man, teaching him tawassul that the Prophet (Allah bless him and grant him peace) had taught the blind man.
(2) Tirmidhi’s hadith is rigorously authenticated (sahih), being the subject of the above investigation of its chain of narrators, the authenticity of which is established beyond a reasonable doubt and attested to by nearly 15 of the foremost hadith specialists of Islam. The hadith explicitly proves the validity of supplicating Allah (tawassul) through a living intermediary, as the Prophet (Allah bless him and grant him peace) was alive at the time. The author of the article holds that the hadith implicitly shows the validity of supplicating Allah (tawassul) through a deceased intermediary as well, since:
The Prophet (Allah bless him and grant him peace) told the blind man to go perform ablution (wudu) pray two rak’as, and then make the supplication containing the words, “O Muhammad, I seek your intercession with my Lord for the return of my eyesight,” which is a call upon somebody physically absent, a state of which the living and the dead are alike.
Supplicating Allah (tawassul) through a living or deceased intermediary is, in the author’s words, “not tawassul through a physical body, or through a life or death, but rather through the positive meaning attached to the person in both life and death, for the body is but the vehicle that carries that significance.
And perhaps the most telling reason, though the author does not mention it, is that everything the Prophet (Allah bless him and grant him peace) ordered to be done during his lifetime was “legislation” valid for all generations until the end of time unless proven otherwise by a subsequent indication from the Prophet himself (Allah bless him and grant him peace), the tawassul he taught during his lifetime not requiring anything else to be generalized to any time thereafter.
(3) The authenticity of Tabarani’s hadith of the man in need during the caliphate of Uthman (Allah be well pleased with him) is not discussed by the article in detail, but deserves consideration, since the hadith explicitly proves the legal validity of supplicating Allah (tawassul) through the deceased, for ‘Uthman ibn Hunayf and indeed all the prophetic Companions, by scholarly consensus (ijma’), were legally upright (‘udul), and are above being impugned with teaching someone an act of disobedience, much less idolatory (shirk). The hadith is rigorously authenticated (sahih), as Tabarani explicitly states in his “al-Mu’jam al-saghir.” The translator (Nuh Ha Mim Keller), wishing to verify the matter further, to the hadith with its chain of narrators to hadith specialist Sheikh Shu’ayb Arna’ut, who after examining it, agreed that it was rigorously authenticated (sahih) as Tabarani indicated, a judgement which was also confirmed to the translator by the Morrocan hadith specialist Sheikh ‘Abdullah Muhammad Ghimari, who characterized the hadith as “very rigorously authenticated,” and noted that hadith masters Haythami and Mundhiri had explicitly concurred with Tabarani on its being rigorously authenticated (sahih). The upshot is that the recommendedness of tawassul to Allah Most High – through the living or the dead – is the position of the Shafi’i school, which is why both our author Ibn Naqib Al-Misri, and Imam Nawawi in his “Al-Adhkar (281-282)”, and “al-Majmu” explicitly record that “tawassul” through the Prophet (Allah bless him and grant him peace) and asking his intercession are recommended. A final article below by a Hanafi scholar concludes the discussion.
The Hanafi scholar, Muhammad Hamid says: As for calling upon (nida’) the righteous (when they are physically absent, as in the words “O Muhammad” in the above hadiths), tawassul to Allah Most High through them is permissible, the supplication (du’a) being to Allah Most Glorious, and there is much evidence for its permissibility.
Those who call on them intending “tawassul” cannot be blamed. As for someone who believes that those called upon can cause effects, benefit, or harm, which they create or cause to exist as Allah does, such a person is an idolator who has left Islam – Allah be our refuge! This then, and a certain person has written an article that tawassul to Allah Most High through the righteous is unlawful, while the overwhelming majority of scholars hold it is permissible, and the evidence the writer uses to corroborate his viewpoint is devoid of anything that demonstrates what he is trying to prove. In declaring tawassul permissible, we are not hovering on brink of idolatory (shirk) or coming anywhere near it, for the conviction that Allah Most High alone has influence over anything, outwardly or inwardly, is a conviction that flows through us like our very lifeblood. If tawassul was idolatory (shirk), or if there were any suspicion of idolatory in it, the Prophet (Allah bless him and grant him peace) would not have taught it to the blind man when the latter asked him to supplicate Allah for him, though in fact he did teach him to make “tawassul” to Allah through him. And the notion that tawassul is permissible only during the lifetime of the person through whom it is done but not after his death is unsupported by any viable foundation from Sacred Law [“Rudud ‘ala abatil wa rasa’il al-Shaykh Muhammad al-Hamid]