diff --git a/src/main/java/sh/libre/scim/core/AbstractScimService.java b/src/main/java/sh/libre/scim/core/AbstractScimService.java index 9586a23a3f..1d32e32355 100644 --- a/src/main/java/sh/libre/scim/core/AbstractScimService.java +++ b/src/main/java/sh/libre/scim/core/AbstractScimService.java @@ -207,15 +207,19 @@ public abstract class AbstractScimService { EntityOnRemoteScimId externalIdAsEntityOnRemoteScimId = groupMemberMapping.getExternalIdAsEntityOnRemoteScimId(); logger.debugf("found mapping for group member %s as %s", member, externalIdAsEntityOnRemoteScimId); groupMember.setValue(externalIdAsEntityOnRemoteScimId.asString()); - try { - String refString = String.format("Users/%s", externalIdAsEntityOnRemoteScimId.asString()); - URI ref = new URI(refString); - groupMember.setRef(ref.toString()); - } catch (URISyntaxException e) { - logger.warnf("bad ref uri for member " + member); - } + URI ref = getUri(ScimResourceType.USER, externalIdAsEntityOnRemoteScimId); + groupMember.setRef(ref.toString()); group.addMember(groupMember); } else { logger.warnf("member %s not found for group %s", member, groupModel.getId());