Basic authentication stuff

To support user logging in snap-server (upcoming pull request).