user authentication tests and implementation