Should a genuine need arise, however, you may ask about the person and say, “Who are you?”—otherwise it may amount to prying into what is none of your business, and “Part of a person’s excellent Islam is to leave alone what does not concern him.” When there is a valid need, therefore, ask so that you are fully informed and proceed with clear insight.
This ḥadīth also shows that it is permissible for someone to describe himself with laudable attributes when he intends mere identification and not boasting. When those Companions were asked, “Who are you?” they replied, “We are Muslims.” Islam is undeniably an honorable description, yet if a person states of himself, “I am a Muslim,” “I am a believer,” and the like—as a simple fact and not out of self-aggrandizement—there is no harm in it. The same applies when he says it out of gratitude for Allah’s favor: “Praise be to Allah who has made me one of the Muslims,” and similar expressions. In that case it is not only permissible but praiseworthy, provided nothing impermissible accompanies it.
Among the further lessons of this report is that when a person truthfully attributes to himself a quality he actually possesses, without pride, this is not the self-praise and self-commendation that Allah forbade when He said, “So do not claim purity for yourselves—He knows best who is truly God-fearing” (53:32).
The ḥadīth likewise indicates that one should capitalize on the presence of a scholar. When those travelers learned that the Messenger of Allah ﷺ stood before them, they immediately began to question him. Similarly, a person ought to seize the opportunity when a scholar is at hand, so that he may ask about whatever perplexes him.