Hi,
I'm creating an environment for training purposes, and I want to reset the environment before each training, and re-populate it with accounts, contacts, and other entities. My environment has Azure B2C integration, and I have a number of users defined in it.
When I originally created a contact for the portal, I also sent an invitation and completed the registration process as the external user. I have the external user in the External Identities table.
What I want to do after a training is:
- Delete all contacts from the environment
- Delete all accounts from the environment
- Delete my application specific entities
- Recreate accounts based on a known list
- Recreate contacts based on a known list
- Recreate my application specific entities based on known data
I have pretty much accomplished all of the above.

The part I'm struggling with is getting the external end user to connect to the portal by just logging in. Whenever I try to re-logon to the portal after recreating the contact and linking it to its external identity, the portal insists on requesting the invitation code and checking the 'I already have an account' option . I must be missing some part where the external identity is matched up with the contact. By re-using the original invitation code I eventually succeed in logging into the portal, but I'd like to avoid this manual step. Any ideas on what I might be missing ?
Kindest regards,
Stephane