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 the portal front end and portal backend. An auto migration of the account from custodian to the state tenant it can cause erroneous migration to avoid its user's acknowledgment is required.
Approach :
...
Step 5: Users re-enter the password. If the password is correct initiate account migration else create a new account for the user.
Conclusions after
...
design discussion
- encrypt the user's identifier (email or phone number) and state token after it verifies the otp and send it to keycloack and receive the same back
- before calling migrate api check if same user is merging or not to do this decrypt the encrypted details and validate the email address from decrypted data and token generated after sign in should have same email id.
- Do we really need subdomain ? if YES - logoff the other user account and create session of state user.
Question to PM?
- verify the message on cancel and merge screen - Rajeev discussed same will be changed by PM.
- is username from state and keycloack auth token is diffent what error message and screen should be shown - Need to show error message in error message screen.
- check if we can use the manual merge screens with username field already having value and user cannot edit it.
Catch in the process- ?
how mobile will login to system in case of google and normal sign as now we are passing the keyclaock token in query and allow user new state user to login to system.
Issues with mobile team-
...
- mobile team will capture the code param given after successful sign from keycloack and store it in memory (check )
- if migrate is successful mobile will generate new session from code and login user else close the flow (check if we get update values of not) new user should be logged in as a state user .
...
- Send state token along with email/Phone number encrypted in redirectUri while opening keycloack page.
- Mobile team should append client_id='andriod'.
- Before calling migrate API portal should perform the following checks
- Decrypt the encrypted data to get state token, user email
- Check if state token is valid using echo API
- Check if state token is not expired.
- Verify the access token
- Check if email Id from encrypted data and the access token is same. - Only after all checks in step 3 are passed migrate API can be called.
- Once migration is done user will be notified via email from backend.
- Mobile related changes -
User will be logged as a nonstate user after the user enters password or Gmail.
Mobile needs to detect by reading the query parameter if auto-merge is in progress or not.
If auto-merge is in progress mobile will call to portal sending encrypted data and access token to migrate the user.
Open questions for the mobile team?
- Once the non-state user is migrated to state user how the data in the mobile client will can updated details
UI Screens
Verify user via email or phone
...