Added authentication functionality