Start by soaking the dried white beans overnight in a large bowl of water. This will help to soften the beans and reduce the cooking time.
Once the beans are soaked, drain and rinse them thoroughly under cold water. Set them aside.
In a large pot, heat the olive oil over medium heat. Add the chopped onion and minced garlic, and sauté until they become soft and translucent.
Add the ground cumin, paprika, ground cinnamon, ground ginger, and cayenne pepper (if using) to the pot. Stir well to coat the onions and garlic with the spices.
Add the soaked white beans to the pot, followed by the diced tomatoes and vegetable broth. Stir everything together, ensuring that the beans are fully submerged in the liquid.
Bring the mixture to a boil, then reduce the heat to low and cover the pot with a lid. Allow the beans to simmer for about 1 to 1 1/2 hours, or until they are tender and cooked through. Stir occasionally to prevent sticking.
Once the beans are cooked, season with salt and pepper to taste. Adjust the seasoning according to your preference.
Serve the Moroccan Stewed White Beans hot, garnished with fresh parsley. This dish is delicious on its own, but it can also be served with crusty bread or over a bed of fluffy couscous for a complete Moroccan experience.