Add support for authentication

Fixes #10.