From 346205f05a84795133a98096e05b39fae79233af Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 9 Mar 2026 16:20:51 +0100 Subject: [PATCH] Returns 409 when user already exist Signed-off-by: Bryan Frimin --- pkg/iam/scim/service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/iam/scim/service.go b/pkg/iam/scim/service.go index 4c0ed3a77..a9c254bd0 100644 --- a/pkg/iam/scim/service.go +++ b/pkg/iam/scim/service.go @@ -218,6 +218,10 @@ func (s *Service) CreateUser( return fmt.Errorf("cannot load profile: %w", err) } } else { + if profile.Source == coredata.ProfileSourceSCIM { + return scimerrors.ScimErrorUniqueness + } + profile.Source = coredata.ProfileSourceSCIM profile.State = profileState profile.FullName = fullName