Authentication

A trivial fix plus the super simplistic first step towards reasonable authentication.
But this is better than nothing.