Mostly working authentication