Skip to content
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

lastModified attribute of the groups does not update #19244

Closed
somindatommy opened this issue Jan 28, 2024 · 3 comments
Closed

lastModified attribute of the groups does not update #19244

somindatommy opened this issue Jan 28, 2024 · 3 comments

Comments

@somindatommy
Copy link
Contributor

Describe the issue:
When a group is modified in the following scenario, the last modified attribute of a group needs to be updated.

How to reproduce:

  1. Create a group.
  2. Navigate to IDN_SCIM_GROUP and notice the value of the urn:ietf:params:scim:schemas:core:2.0:meta.lastModified attribute.
  3. Update the name of the group.
  4. Check urn:ietf:params:scim:schemas:core:2.0:meta.lastModified attribute. The value remains the same.
  5. Now add or remove users from the group.
  6. Check urn:ietf:params:scim:schemas:core:2.0:meta.lastModified attribute. The value remains the same.

Expected behavior:
Modified time needs to change when ever a change is done to the group.

Environment information (Please complete the following information; remove any unnecessary fields) :

  • Product Version: Latest IS 7
  • OS: [e.g., Windows, Linux, Mac]
  • Database: MySQL
  • Userstore: JDBC

Optional Fields

Related issues:

Suggested labels:

@DMHP
Copy link
Contributor

DMHP commented Feb 13, 2024

I am removing this issue from the IS 7.0.0 project board based on the complexity and the IS -7.0.0 timelines.

@ThaminduDilshan
Copy link
Contributor

ThaminduDilshan commented Dec 19, 2024

With the new changes, the behaviour is different in the latest IS pack. IDN_SCIM_GROUP table contains only the roles. Group details are now by default added to the UM_ROLE table for JDBC user stores and the last modified time is stored in a table column.

  • When updating name of the group, the lastModified value is changed accordingly in the SCIM response. However the UI doesn't show the correct last modified value.
    Screenshot 2024-12-19 at 2 11 53 PM

  • When adding/ removing a user to/ from the group, it doesn't update the lastModified value.

Explanation:

  • When the group unique id is enabled which is the default behaviour for IS 7.0.0 and above, groups are retrieved from the user store and hence the last modified date is stored in the UM_ROLE table (i.e. userstore tables). When updating the group name, doUpdateGroupNameByGroupId [1] or a similar method is invoked and that method sets the last modified value to the current timestamp. However when adding/ removing users to/ from a group, doUpdateUserListOfRoleWithID or a similar method is invoked and it doesn't update the last modified date value. Group details including last modified date and user-group mappings are stored in two different tables and the update cannot be performed in a single DB query.

  • There are two possible ways to resolve this issue.

    1. Update last modified date from the SCIMUserManager [2] when updating or modifying a group.
    2. Update last modified date from the user store manager itself.

    The ideal solution is to fix this in the user store manager class.

  • When the group unique id is disabled, group details including last modified date is stored in the IDN_SCIM_GROUP table. Hence the fix for this scenario should be done from the relevant scim DAO layer.

[1] https://github.com/wso2/carbon-kernel/blob/5a3d028f0d665bf4622bb63a7bad346bf9ed8769/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/UniqueIDJDBCUserStoreManager.java#L4293
[2] https://github.com/wso2-extensions/identity-inbound-provisioning-scim2/blob/c457f30b6f0cfc1dc4cb8d5e39032bcd79299ad0/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java#L3496

@nilasini nilasini modified the milestones: 7.1.0-m7, 7.1.0-alpha Jan 15, 2025
@sadilchamishka sadilchamishka moved this from In Progress to Done in Identity Server 7.1.0 Jan 21, 2025
@sadilchamishka sadilchamishka closed this as completed by moving to Done in Identity Server 7.1.0 Jan 21, 2025
@nilasini nilasini modified the milestones: 7.1.0-alpha, 7.1.0-m8 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

8 participants