Implemented check_authentication