wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

Handling user creation using SCIM when workflow engagements related to user addition are enabled #10442

Closed DinikaSen closed 2 weeks ago

DinikaSen commented 4 years ago

Describe the issue:

When creating a user via SCIM2, the user addition is done by addUserWithID[1] user-core method which returns the created user. However, when workflow engagements associated with "Add user" operation are configured, user addition happens in a PreAddUser listener [2]. Therefore, the addUserWithID user-core method returns null (See issue : https://github.com/wso2/product-is/issues/10390) which results in a NPE. Also, the created user does not have a userID. A temporary fix for this has been introduced by PRs [3],[4]. However, a proper solution to handle this situation needs to be implemented.

[1] https://github.com/wso2/carbon-kernel/blob/6fb8c5fc25ea78d6535de1171ee89e1341e496bc/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/common/AbstractUserStoreManager.java#L13750 [2] https://github.com/wso2-extensions/identity-user-workflow/blob/f5ed8a3e830cb802b3bd66f4d5b7253e9bf277fb/components/org.wso2.carbon.user.mgt.workflow/src/main/java/org/wso2/carbon/user/mgt/workflow/userstore/UserStoreActionListener.java#L64 [3] https://github.com/wso2-extensions/identity-inbound-provisioning-scim2/pull/306 [4] https://github.com/wso2/charon/pull/295

How to reproduce:

  1. Add a New Workflow Definition
  2. Create a workflow engagement associated with the 'Add user' operation
  3. Create a user via the console application(or using SCIM2 APIs)

Expected behavior: When workflow engagements are involved, adding a user via SCIM2 should respond with "202 Accepted" status, and no error should occur.

isharak commented 2 weeks ago

This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!