Authenticate user before accessing the application