First of all, bicycles do not use dynamos but alternators. There are many ways to solve the problem once the AC from the alternator has been converted into a filtered DC. These are the most simple ones:
- Put in series to the series combination "resistor - LED" a voltage limiter. It can be build using a simple Zener diode, resistor and a NPN BJT power transistor.
- LED's are actually current devices; as such they "like" to operate in constant current mode, therefore a current source could be good solution. You can google and find how to build a current source.
- Use a voltage regulator
It is evident that the "surplus" power generated when you are going downhill, for example, will be "wasted" in the devices that are limiting the voltage, therefore they must be able to dissipate the heat with a suitable hitsink. To avoid this issue, more sophisticated circuitry is required.
Gene