Imam Muwaffaquddin (May Allah shower His Mercy on him) has related the opinion of Imam Azam Abu Hanifa (May Allah be well pleased with him) in Fadhaaili Imam Azam (May Allah be well pleased with him) that with regard to affirmation, people are of 3 kinds. Some are those who affirm with their tongues and in their hearts whatever has come from Almighty Allah. Some affirm only with their tongues and some others affirm only in their hearts.
Those who affirm with their tongues and in their hearts are considered believers by Allah Most High and by the creation. Those who affirm only with their tongues and deny in their hearts, they are considered as disbelievers by Almighty Allah and as believers by the people, as they don’t know what is hidden in the hearts. People should consider them as believers because of their testification of the true faith and shouldn’t try to find out what lies in their hearts. Those who affirm in the hearts and outwardly deny it, to hide their faith (for whatever reason), they are believers with Allah Most High and disbelievers with those who don’t know this.
Thus, to consider someone as Muslim, it is not necessary to ascertain what lies in the heart. If this were the case, then it wouldn’t have been right to consider someone a Muslim. This would have led to differences and even hostility among Muslims. For this reason, the Shariah has ordained that whoever expresses Islam with words and actions, that person should be considered a Muslim. That person shouldn’t be treated like a non-Muslim. Almighty Allah says in the Holy Quran:
Similarly, the Holy Prophet (Sallallahu alaihi wa sallam) has also said: Whoever testifies to the Oneness of Almighty Allah and My Prophethood and offers Salaat, gives Zakaat, etc., that person’s life and wealth are safe.
Thus, Islam and inward Imaan will be judged as per the apparent outward state. Similarly, if the outward state indicates disbelief, then the ruling of disbelief will be given. Shaykh Ibn Taimiyah also writes the same in As Saarimul Maslool.
It is mentioned in Sharh Maqaasid, etc. that the Law-Giver has declared some sins to be indications of lack of affirmation like enmity with the Holy Prophet (Sallallahu alaihi wa sallam), throwing away the Holy Quran in dirt/filth, prostrating to an idol, etc.
With this, the Muslims can understand that if person says that whatever is there in the Holy Quran and the Hadith, which goes against the (present corpus of) knowledge has to explained away in some other manner, meaning that they shouldn’t be accepted as they are, then this person should be considered as.
In As Saif Ul Maslool, Imam Taqiuddin has written that the consensus of opinion is that it is imperative to execute the Muslim who says anything unbecoming about the Holy Prophet (Sallallahu alaihi wa sallam). He has written that Hadhrat ‘Umar (May Allah be well pleased with him) has given a clear unambiguous order that the person who abuses Allah Most High or any Prophet should be executed. Imam Shafa’ee (May Allah be well pleased with him) holds that the person who makes fun of any verse of the Holy Quran goes out of the pale of Islam and that this person should be declared as such based on the outward indications.
As Shaykh Ibn Taimiyah has written in As Saarimul Maslool.
The sum of all these is that the person who blasphemes about Allah Most High and the Holy Prophet (Sallallahu alaihi wa sallam) is liable to be executed, even though it might only be an insinuation. If a person says that the asceticism of the Holy Prophet (Sallallahu alaihi wa sallam) was not by His choice and if He had better things, He would have consumed them. Even such a person is liable to be executed.
The aforementioned Traditions prove that even if a person expresses Islam, but if the aforementioned indications are found in that person, that person will still be considered a disbeliever. That person’s remonstrations that he is a Muslim or that Islam is expressed through him (i.e. his speech, actions, etc.) will be of no use.
This was on denial of a single verse of the Holy Quran. Allah Most High says:
So that, (O people,) you may believe in Allah and His Messenger (blessings and peace be upon him) and may help his (Din [Religion]), and revere and venerate him heart and soul, and (with that) glorify Allah morning and evening. Surah Fatah (48:9)
We have seen in the previous lines that faith is neither a formal affirmation nor realization. Unless and until 10 things are present, faith cannot be present. Even though this might seem really difficult, but if Allah Most High opens the bosom of someone, then no problem remains.
Thus, there is a Hadith in Sahih Bukhari that in the Battle of Uhud, a Bedouin had come only to watch the battle. He had some dates in his hand and was nonchalantly eating them. Suddenly, he got a thought which became the means of guidance. He asked the Holy Prophet (Sallallahu alaihi wa sallam): If I fight for you, where will I be? The Holy Prophet (Sallallahu alaihi wa sallam) answered:
On the other hand, there were many people who were shown miracles for their whole life and they had complete realization and the Holy Prophet (Sallallahu alaihi wa sallam) had exhorted them as well and they knew that the Holy Prophet (Sallallahu alaihi wa sallam) never lies, but even then they didn’t accept it.
[Excerpted from Maqasid Ul Islam, Vol. 1]