First version of code to authenticate against external database.