The UK did have compulsory ID cards, which needed to be carried at all times, during both World Wars.