Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Constants {
public static final String PASSWORD_KEY = "password";
public static final String CONSENT_KEY = "consent";
public static final String PREFERENCE_KEY = "preference";
public static final String ANONYMOUS_PROFILE_TRACKER = "anonymous_profile_tracker";
// Constants for DataDTO parameters.
public static final String REDIRECT_URL = "redirectUrl";
public static final String VALIDATIONS = "validations";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.HashMap;
import java.util.Map;

import static org.wso2.carbon.identity.flow.execution.engine.Constants.ANONYMOUS_PROFILE_TRACKER;
import static org.wso2.carbon.identity.flow.execution.engine.Constants.OTFI;
import static org.wso2.carbon.identity.flow.execution.engine.Constants.STATUS_COMPLETE;
import static org.wso2.carbon.identity.flow.mgt.Constants.FlowTypes.REGISTRATION;
Expand Down Expand Up @@ -93,8 +94,9 @@ public FlowExecutionStep executeFlow(String tenantDomain, String applicationId,
FlowExecutionContext context = null;
boolean isFlowEnteredInIdentityContext = false;
GraphConfig graphConfig = null;
boolean isInitiation = StringUtils.isBlank(flowId);
try {
if (StringUtils.isBlank(flowId)) {
if (isInitiation) {
// No flowId present hence initiate the flow.
context = FlowExecutionEngineUtils.initiateContext(tenantDomain, applicationId, flowType);
} else {
Expand All @@ -120,6 +122,15 @@ public FlowExecutionStep executeFlow(String tenantDomain, String applicationId,
context.getUserInputData().putAll(inputs);
}

// On the initial request of the registration flow, move the anonymous_profile_tracker value (if
// provided) from the user inputs into the flow context properties so that it is retained throughout
// the flow and not treated as a user input during the subsequent input validations.
if (isInitiation && REGISTRATION.getType().equals(context.getFlowType())
&& context.getUserInputData().containsKey(ANONYMOUS_PROFILE_TRACKER)) {
context.setProperty(ANONYMOUS_PROFILE_TRACKER,
context.getUserInputData().remove(ANONYMOUS_PROFILE_TRACKER));
}

context.setCurrentActionId(actionId);
for (FlowExecutionListener listener :
FlowExecutionEngineDataHolder.getInstance().getFlowListeners()) {
Expand Down
Loading