Skip to main content

Notifications

Power Pages - General Discussions
Answered

Automatically Creating User Accounts in Power Page

(0) ShareShare
ReportReport
Posted on by 48
I need to create user accounts for individuals before they log in for the first time on a Power Page app. In my Dataverse, I have a custom table called "Person" that contains details of the people I want to grant access to the Power Page. What steps should I follow to automatically create Power Pages accounts for them without requiring manual registration on the site?
 
My ultimate goal is to display on the Power Page a grid of records containing only the WorkOrders associated to an account the logged-in person is member of. WorkOrders are created by licensed users directly on Dataverse through a Model-Driven App, thus the Power Page User have to read and modify just her own.
Categories:
  • ___Pool___ Profile Picture
    ___Pool___ 48 on at
    Automatically Creating User Accounts in Power Page
    Thank you Fubar I found this interesting blog post which drive me to the External Id onboard process through Microsoft Entra: https://readyxrm.blog/2024/08/16/power-pages-onboarding-external-identity-users/
  • Suggested answer
    Fubar Profile Picture
    Fubar 7,675 on at
    Automatically Creating User Accounts in Power Page
    The answer to your last question is Yes. There are at least 2 ways to achieve it:
    • Create the External Identity record in dataverse - this what links your external identity provider to the contact record (holds the url and the guid of the AD/Entra user). You also need to update the Contact's Security Stamp (with a guid), Login Enabled, and username fields. OR
    • In Power pages, configure your Entra external identity provider to use email mapping (is under a collapsed Advanced/Additional expander) - obviously for this one to work you need to have unique email addresses for your contacts (that match the entra).
    You can also limit users from your Entra so only specific users or groups have access to the portal, by configuring conditional access on the Power Pages Site application (each site has its own Application) in Azure.
  • ___Pool___ Profile Picture
    ___Pool___ 48 on at
    Automatically Creating User Accounts in Power Page
    For completeness of the thread, I would like to add another byte: as a default authentication method, alternatively to redeem code, it is also possible to log in with Microsoft Entra ID Authentication. As usual when the user logs in a Contact is created on Dataverse. In my scenario would it be possible to create a Contact beforehand and associate it somehow to the Microsoft EntraID user such that the Power Page User login associate the logged in user to the Contact previously created?
     
    Here is a screenshot, the button is the red highlited on the right:
     
  • Verified answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 9,050 on at
    Automatically Creating User Accounts in Power Page
    Do you mind flag the answer as verified? You can flag multiple answers if you needed
  • ___Pool___ Profile Picture
    ___Pool___ 48 on at
    Automatically Creating User Accounts in Power Page
    Thank you all for your support, the whole answer is the union of those I liked: Oliver,  Mahendar, Fubar. The question on the title is answered by Oliver. 
  • Mahendar Pal Profile Picture
    Mahendar Pal 191 on at
    Automatically Creating User Accounts in Power Page
    Hi,
     
    To your questions "I need to show the logged-in user only the records related to the Account that the Contact (the logged-in user) belongs to. Is there a standard way to achieve this?" 
     
    -- We control this using web roles, based on the web roles you can control visibility of the Account based on the contact, 
     
    I have post for the cases but it should give you idea what you need to do for the accounts :)
  • Suggested answer
    Fubar Profile Picture
    Fubar 7,675 on at
    Automatically Creating User Accounts in Power Page
    For only showing details from the the Account, you do this by configuring appropriate Table Permissions for the Web Role(s) you assign to the Contact record (or the authenticated Web Role they inherit from).
     
    It depends on the relationship that you are using between the Contact and Account records.
    • If you are using the out of the box parent account (Company Name) to link the Contact to Account then if you have an Account Lookup on the table that holds the data you can create a table permission with Scope = Account. If you have a parent child situation e.g. Invoice -< Invoice Line item you would Table Permission Scope = Account on the Invoice Table, then a Table Permission with scope Parent (aka Child) for the relationship between Invoice and the Line item (using parent means you do not need an account Lookup on the Line Item)
    • If NOT using the out of the box parent account (Company Name) to link, then you would not use scope = Account instead use a Table Permissions with scope = Parent (the scope = Account is specific to the out of the box relationship)
  • Hems Worth Profile Picture
    Hems Worth 2 on at
    Automatically Creating User Accounts in Power Page
    To automatically create user accounts for individuals in your Power Pages app using data from the "Person" table in Dataverse, enable authentication (Azure AD or Microsoft Identity) for your site. Then, set up a Power Automate flow or Azure Function to automatically create users in Azure AD when new records are added to the "Person" table.
    After user creation, assign appropriate security roles to control access to data. Finally, implement row-level security (RLS) on the WorkOrder table to ensure users can only view and modify their associated records based on their identity. This process ensures seamless user provisioning and access control on your Power Page.
  • ___Pool___ Profile Picture
    ___Pool___ 48 on at
    Automatically Creating User Accounts in Power Page
    Thank you for your response, Oliver. The shared links answered half of my doubts, and that is great. In fact, the other half is my next question: I need to show the logged-in user only the records related to the Account that the Contact (the logged-in user) belongs to. Is there a standard way to achieve this?
  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 9,050 on at
    Automatically Creating User Accounts in Power Page
    Hi, a Portal User is represented by a Contact record in your Model-Driven App, you can use the Person table as temporary data if needed, but I am not sure you need that at all.
     
    Ultimately you will need to create the Contact record and then invite them to the Portal.
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard