1. In a medium pot, combine beans with 2 cups water and bring to a boil. Reduce heat to low and cook for 20 minutes, until beans are soft. Puree in blender.
2. In a bowl, beat coconut milk and sugar until frothy. Add eggs and beat well. Add bean puree and mix thoroughly. Put mixture in a saucepan and cook over medium heat until mixture begins to thicken.
3. Pre-heat oven to 350-degrees. Grease an 8-inch square cake pan (use metal or unbreakable glass). Fold mixture into pan. Bake for 20 minutes. Raise heat to 450-degrees and bake another 25 to 30 minutes, until cake turns a deep amber.
4. Remove from oven and immediately immerse pan in 1/2 inch cold water for 10 minutes. Change water to ensure it stays cold and leave pan another 15 minutes.
5. In a small pan, sauté the shallots until light brown. Drain off the oil and spread the shallots over the top of the cake or before baking. Cut into 9 squares. Serve warm or cold.