Adds most of authentication.