This validation is repeated in the SsoController.php, would it be possible to refactor that?