implement the authentification function