Implement authentication

That is, make it actually work :)