Peel the skin off the chicken legs and loosen the meat from the bones. Cut into strips across the grain. Remove the zest from the lime and squeeze out the juice. Marinate the meat with it.
Heat the oil and fry the shallots and garlic until light brown. Add the curry paste and fry until it starts to smell. Fry the chicken, stirring constantly, then add the green beans, celery, finely chopped spinach, chili cubes and lime marinade. Pour in coconut milk and chicken stock. Mix well and simmer covered over medium heat for 20 minutes.
Roast the desiccated coconut in a pan without oil.
Remove the lid from the curry and let the sauce boil down. Season to taste with salt, cane sugar and soy sauce. Sprinkle with the toasted desiccated coconut to serve.