Overview:
Currently, Any user initiating a first time SSO login using an identifier that already exists in the custodian org - causes an auto migration of the account from custodian to the state tenant it can cause erroneous migration to avoid it user's acknowledgment is required.
If the user is found to match an account in the custodian org when the user tries to login via SSO for the first time, the user should be prompted about the existence of the duplicate account and asked whether the account belongs to them.
...
Account auto-merge workflow should be handled in portal securely. Currently only the existing user's are migrated
...
Flow chart:
...
Step 2: An OTP is generated and the user is allowed to enter received OTP.
Step 3: For new users, if email id is already found in dupe check show user a confirmation popup to initiate account migrate. If the user deny to merge denies merging deactivate the non state nonstate user account and create a new account.If the user allows to merge merging goto step 4
Step 4: User is allowed to enter the password if the password is correct initiate migration of account else allow the user to re enter reenter the password.
Step 5: Users re enters -enter the password. If the password is correct initiate account migration else create a new account for the user.