That there's actually an international law against this as well. Check out Art. 45 of the Hague convention (iv). "Art. 45. It is forbidden to compel the inhabitants of occupied territory to swear allegiance to the hostile Power. " Maybe there can be an exception for people living in East Jerusalem?
Germany shelves Nazi crimes probe of US national Karkoc (AP)
from the article: I am not declaring loyalty