diff --git a/data/users/externaloidc.py b/data/users/externaloidc.py index 651ab68306..26a57bba8e 100644 --- a/data/users/externaloidc.py +++ b/data/users/externaloidc.py @@ -35,9 +35,12 @@ def is_superuser(self, username: str): def verify_credentials(self, username_or_email, password): """ - Verify the credentials with OIDC: To Implement + Unsupported to login via username/email and password """ - pass + return ( + None, + f"Unsupported login option. Please sign in with the configured {self._federated_service} provider", + ) def check_group_lookup_args(self, group_lookup_args, disable_pagination=False): """ diff --git a/test/test_external_oidc.py b/test/test_external_oidc.py index 0e338db6d5..c36265319c 100644 --- a/test/test_external_oidc.py +++ b/test/test_external_oidc.py @@ -205,3 +205,11 @@ def test_sync_user_groups_for_empty_user_obj(self): self.oidc_instance.sync_user_groups(user_groups, user_obj, self.oidc_login_service) user_teams_after_sync = TeamMember.select().where(TeamMember.user == user_obj).count() assert user_teams_before_sync == user_teams_after_sync + + def test_verify_credentials(self): + result, error_msg = self.oidc_instance.verify_credentials("username", "password") + assert result is None + assert ( + error_msg + == "Unsupported login option. Please sign in with the configured oidc provider" + )