finally got user authentication working.