Add authentication

fixed #1