Added authentication and logout.