This story by the nineteenth-century Spanish novelist and folklorist Cecilia Böhl de Faber appears in her Cuentos andaluces (Andalusian Tales, 1859). In the prologue she tells us that these tales come from the oral tradition of southern Spain (Andalusia), and as Christianity is rooted in that tradition, “Juan Soldado” exemplifies it through his encounters with Christ and Saint Peter on the one hand and a young Satan and Lucifer on the other.
Fedorchek, Robert M.. "Juan Soldado." Marvels & Tales 19.2 (2005). Web. <https://digitalcommons.wayne.edu/marvels/vol19/iss2/6>.