-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: SCIM error handling for group display name (fixes #20344) #557
Changes from 3 commits
8388c51
9f11dc4
d18b5ae
b974ba9
33c09b9
0961878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1125,7 +1125,13 @@ 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())) { | ||
throw new BadRequestException(e.getMessage()); | ||
// 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without hardcoding here you can directly use ResponseCodeConstants.INVALID_SYNTAX constant in charon scimType variable is also redundant then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in b974ba9 |
||
|
||
// Throw BadRequestException with custom message and scimType | ||
throw new BadRequestException(errorMessage, scimType); | ||
} | ||
throw new CharonException( | ||
String.format("Error occurred while updating groups in the role with ID: %s", roleId), e); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct place to handle the mentioned error?
Issue should be directly taking
display eq ...
something as group idWe have to throw the error from that place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in b974ba9