Code to authenticate user.

Task  #57