Added authentication functionality.