i dont know if related but i once had a problem that was a bit similar, from what i can remember it was sort of the opposite, i couldnt log in but once i was logged in (via figuring out what a US keyboard looked like and pressing the keys on my norwegian keyboard as if it was american) everytyhing worked
so after that i looked up US keyboard layout and made sure i only used characters that were the same on my NO keyboard as on the US keyboard.
for example on both keyboads shift + 3 produces a #
on my keyboard shift + 6 produces a &
on US keyboard it produces something else
so i made a list of keys i can use and cant use
if this makes sense
as i said not sure if this is related to your problem