Added some code for authentication.  Doesn't work yet though