diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java index 63cfab4b9..0b755eb03 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java @@ -1125,7 +1125,12 @@ private void doUpdateGroups(String roleId, Set newGroupIDList, Set(deleteGroupIDList), tenantDomain); } catch (IdentityRoleManagementException e) { if (RoleConstants.Error.INVALID_REQUEST.getCode().equals(e.getErrorCode())) { - throw new BadRequestException(e.getMessage()); + // Custom error message and SCIM type + String customMessage = "Invalid request: Group display name is not supported. Please use the group ID instead."; + String scimType = "invalidSyntax"; // From RFC 7644 Table 9 + + // Throw BadRequestException with custom message and scimType + throw new BadRequestException(customMessage, scimType); } throw new CharonException( String.format("Error occurred while updating groups in the role with ID: %s", roleId), e);