There is a tradition from numerous ancient and medieval sources that Solomon had command over demons because he was the wisest man who ever lived and knew their name and all the ways to control them. This developed into the idea that Solomon had such control over demons that he could force them to build a temple for God against their will, and this is how the First Temple was built. This belief was common in the middle ages but not ever officially sanctioned by the Church.
There is a tradition from numerous ancient and medieval sources that Solomon had command over demons because he was the wisest man who ever lived and knew their name and all the ways to control them. This developed into the idea that Solomon had such control over demons that he could force them to build a temple for God against their will, and this is how the First Temple was built. This belief was common in the middle ages but not ever officially sanctioned by the Church.
For more reading-
https://www.wikipedia.org/wiki/Seal_of_Solomon
https://www.wikipedia.org/wiki/The_Lesser_Key_of_Solomon
https://www.wikipedia.org/wiki/Testament_of_Solomon