A Nazi-obsessed man has been jailed for attempted murder after he stabbed an asylum seeker in a terrorist attack.