The following paragraph is from Dr. Asher Eder’s book The Star of David, which was published in 1987 in English in Jerusalem by Rubin Mass Ltd. The publication here is courtesy of Oren Mass
In the Middle Ages, the star also played quite some role in the Kabbalists' understanding and description of the world , while the very term,Magen David, rendered "Shield of David" or "Star of David") for describing the hexagram was used in Jewish literature for the first time, as far as we know, by the Kabbalist Joseph Gikatilla in the 13th Century, and then shortly after that by a grandson of the famous Rabbi Nahmanides, in his treatise Sefer ha'Gevul. There, he uses the hexagram twice, both times calling it Magen David .
It is not known whether these renowned rabbis were the first to identify the hexagram as Magen David, or whether they expressed an already existing custom. There are hints that David Elroi, the leader of a big messianic movement at the 12th century, adopted the Magen David as the sign for his campaign by which he tried to liberate the country from the Crusaders. Shortly after, the Karaite Yehudah Hadassi, who lived in Constantinople, used the term Magen David to describe the hexagram, but thought its six corners represented the four directions of the compass, the earth and heaven.
The examples cited so far may indicate a certain affinity between the Jewish people and the six-pointed star, but since other communities also used it, as we will see in the next chapter, we can only say that it was used in ancient times by both Jews and non-Jews. Yet, apparently the Magen David begins its consistent history in Judaism with these medieval Kabbalists.