web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Automatically create c...
Power Pages
Answered

Automatically create contact and link to Azure B2C user

(0) ShareShare
ReportReport
Posted on by 302

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.

bouillons_0-1669328448223.png

 

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

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    If your External Identity record is valid, on the Contact record you will need to set

    • Login Enabled: Yes  
    • Security Stamp: to a GUID  - Flow has something like guid() to generate one or you could possibly use the one from the identity provider url

    If you set Login Enabled and the leave the Security Stamp empty you will get past the Register page - but will get an error.

  • bouillons Profile Picture
    302 on at

    Thank you so much for your time and effort ! I pass through the authentication 🙂

    Upon the first login, the user's Profile page is shown, with a message that "Your e-mail requires verification". Ideally, I'd want to avoid this as well. Is that also a field on the contact ?

    Thanks again,

    Stephane

  • Verified answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    There is a field on the Contact record called something email to Email Confirmed that you can set Yes. 

     

    If you want to turn it off/on all together you can set the Site Setting "Authentication/Registration/EmailConfirmationEnabled" true or false

  • bouillons Profile Picture
    302 on at

    Note that to make it work, you also need to set the B2C username guid on the contact (adx_identity_username). If you set the Profile Modified On to a datetime value, the user will bypass the profile page upon login.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 71

#2
DP_Prabh Profile Picture

DP_Prabh 36

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 32 Most Valuable Professional

Last 30 days Overall leaderboard