finish authentication, including some modifications