 According to the late medieval mystic Jami, Abd-Allah ibn Muhammad ibn al-Hanafiyyah (died c. 716) was the first person to be called a "Sufi".Two of Al Ghazali's greatest treatises, the "Revival of Religious Sciences" and the "Alchemy of Happiness," argued that Sufism originated from the Qur'an and was thus compatible with mainstream Islamic thought, and did not in any way contradict Islamic Law—being instead necessary to its complete fulfillment.This became the mainstream position among Islamic scholars for centuries, challenged only recently on the basis of selective use of a limited body of texts .