Implements the authentication function