The Medrash in Parsha Ki Sisa says the following story:
Shlomo HaMelech had a beautiful and wise daughter. As she got older, he sought a husband for her. Astrologers advised the king that she was destined to marry the poorest man in the kingdom.
Shlomo HaMelech understood that if this was Hashem’s choice, it would be, but decided to create an opportunity for people to clearly see Yad Hashem. So, on a small island in the Mediterranean Sea, he built a castle and surrounded it with high walls. Placing his daughter in this castle under the watch of seventy of his most trusted elders, the king sealed the door – he had the only key.
“Now I’ll see how G-d fulfills his mission,” said the wise king.
Many months passed. One day a young man was wandering alone in a forest on his travels to a certain city. He was tired and hungry and, as night approached, began looking for shelter. He spied an empty carcass of a cow and crept inside it to keep warm and quickly fell asleep.
Soon a large eagle approached and, seeing the carcass, lifted it up with the man in it and soared away looking for a place where he could eat in solitude. After a while, he landed on the roof of the princess’s castle on the island.
When the young man awoke, he did not know where he was. As he looked around, the princess looked out and saw him.
“Who are you and what are you doing her?” she asked.
“I am a young Jew from the city of Acco and it seems a large bird carried me here,” he said.
Noticing his tattered clothes, the princess brought him into the castle and found him suitable clothing and food to eat. There was such a transformation in the young man after he bathed and dressed in the aristocratic clothes. In conversation it became clear that the young man was a talmid chacham who spent his days steeped in learning.
After a short time, the princess asked him if he would marry her.
“With all my heart,” was the reply. “But how can we?”
It is said that the Malach Gavriel acted as an witness and the young man pricked his finger and used his own blood to write the kesuva.
After a few days, the guards discovered what happened and quickly sent word to Shlomo HaMelech that despite their vigilance the young princess had married.
Some days later Shlomo HaMelech arrived at the island and questioned his daughter, “This is my husband whom G-d sent me down from the heavens,” she said. “He is a talmid chacham and we have been halachically married.” She then produced their marriage contract which was written in their blood.
Shlomo HaMelech was overjoyed that she had met her destined mate and that Hashem’s clear hashgacha would be seen by all.
Does anyone know where in the Medrash this story can be found?