Skip to content

Commit

Permalink
Generalize SCIM error message for invalid request values (fixes #20334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bimsara Bodaragama authored and Bimsara Bodaragama committed Jun 28, 2024
1 parent 9f11dc4 commit d18b5ae
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,9 @@ private void doUpdateGroups(String roleId, Set<String> newGroupIDList, Set<Strin
new ArrayList<>(deleteGroupIDList), tenantDomain);
} catch (IdentityRoleManagementException e) {
if (RoleConstants.Error.INVALID_REQUEST.getCode().equals(e.getErrorCode())) {
// Custom error message and SCIM type
String errorMessage = "Invalid request: The provided value is not supported. Please use the group ID instead.";
// Error message and SCIM type
String errorMessage = "Updating groups of the role by display name is not supported. "
+ "Update using group id instead.";
String scimType = "invalidSyntax"; // From RFC 7644 Table 9

// Throw BadRequestException with custom message and scimType
Expand Down

0 comments on commit d18b5ae

Please sign in to comment.