Microsoft Entra External ID Solution

A practical guide to user authentication, Power Pages identity association, authorization, and sign-in email changes.

Contents

1. Solution overview

A Power Pages site can use Microsoft Entra External ID to authenticate external users. Dataverse stores each site user's Contact record, authorization configuration, profile information, and application-specific business data.

The central idea
The email address is the name the user enters at sign-in. The Entra user ID is the stable account identifier. Changing the sign-in email does not create a new account.

External user
    |
    | signs in with email and password
    v
Microsoft Entra External ID
    |
    | returns a signed identity token
    v
Microsoft Power Pages
    |
    | associates the identity with a Contact
    v
Microsoft Dataverse  --------->  SharePoint Online
Contact + business records        Related documents

2. Main components

Microsoft Entra External ID

Owns the external user account, sign-in identity, password, MFA methods, authentication policies, and identity tokens.

Microsoft Power Pages

Acts as the portal application, validates the Entra token, creates the portal session, and connects the identity to a Dataverse Contact.

Microsoft Dataverse

Stores Contacts, web roles, table permissions, profile information, and application-specific business data.

Microsoft Graph

Provides the secure backend API used to update the Entra user when a solution supports a custom sign-in email change.

3. Authentication methodology

Authentication answers one question: Who is signing in? Entra performs the credential check; Power Pages consumes the result.

  1. The user opens the Power Pages site. Power Pages redirects the browser to the configured Entra External ID user flow.
  2. Power Pages identifies itself. The request includes the Entra Application/Client ID and approved redirect URL.
  3. The user enters credentials. Entra uses the email sign-in identity to locate the account and validates the password and required MFA.
  4. Entra issues an ID token. The signed token identifies the user, tenant, and intended application.
  5. Power Pages finds the Contact. Power Pages uses the stable oid or sub identity value to find the related Dataverse Contact.
  6. Power Pages creates the portal session. The user can access pages and records allowed by web roles and table permissions.

Example identity token

{
  "oid":   "U-123",
  "sub":   "P-987",
  "email": "[email protected]",
  "aud":   "APP-456",
  "tid":   "TENANT-001"
}

The Power Pages site ID is not part of the email identity
The email belongs to the Entra user. The Power Pages application is identified separately by its Application/Client ID and redirect URL.

4. Authorization methodology

Authorization answers a different question: What is this authenticated user allowed to access?

Control Purpose
Power Pages web roleDefines the portal role, such as Authenticated Users.
Dataverse table permissionLimits access to records related to the signed-in Contact.
Page permissionRestricts protected pages to appropriate web roles.
SharePoint document integrationAllows document access through the authorized Dataverse parent record and Document Location permissions.

Authentication does not grant data access by itself
A valid Entra login proves control of the account. Power Pages and Dataverse still decide which site records the Contact may access.

5. Important identifiers

Identifier Example Changes with email?
Entra user/object IDU-123No. This is the stable account identifier.
Email sign-in identity[email protected]Yes. This is changed through Microsoft Graph.
Application/Client IDAPP-456No. This identifies the Power Pages application.
Dataverse Contact IDC-789No. The user remains linked to the same Contact.
Contact communication emailemailaddress1Only if the solution intentionally synchronizes it.
Before email change
-------------------
Entra user ID:       U-123
Sign-in email:       [email protected]
Application ID:      APP-456
Dataverse Contact:   C-789

After email change
------------------
Entra user ID:       U-123             unchanged
Sign-in email:       [email protected]     changed
Application ID:      APP-456           unchanged
Dataverse Contact:   C-789             unchanged

6. Sign-in email change methodology

Entra External ID does not provide a complete Power Pages self-service sign-in email-change experience. The solution must implement the verification and backend update process.

  1. Collect the new email. The authenticated user enters a new sign-in email in Power Pages.
  2. Create an Email Change Request. Dataverse records the Contact, Entra user ID, old email, new email, status, expiry, attempt count, and error details.
  3. Verify the new address. The solution sends a time-limited code or link. Nothing changes until verification succeeds.
  4. Update Entra using Microsoft Graph. A server-side component changes the email identity's issuerAssignedId.
  5. Update the profile email if required. If sign-in and communication emails must match, update the Dataverse Contact after Entra succeeds.
  6. Complete and audit the request. Store completion and support information without storing the verification code in plain text.

Recommended Power Pages implementation

Power Pages user interface
        |
        v
Dataverse Email Change Request
        |
        v
Dataverse Custom API / asynchronous plug-in
        |
        v
Microsoft Graph
        |
        +----> Entra sign-in email
        |
        +----> Contact profile email, if required

Microsoft Graph collection update
Updating identities[] replaces the collection. The backend must preserve other existing identities while changing the email entry.

7. Failure handling

Failure Expected behaviour
Verification code is wrong or expiredReject or expire the request. Keep the old sign-in email.
New email is already usedReject the request. Do not retry.
Temporary Graph errorRetry server-side using Retry-After or exponential backoff, with an attempt limit.
Permanent Graph errorMark failed, record the error, and route it to support.
Entra succeeds but Dataverse update failsLogin still works. Record and retry the profile synchronization.

Data consistency, not normally a login outage
If Entra succeeds but Contact synchronization fails, the user can still sign in. The risk is an outdated profile, incorrect notifications, or stale data reused by the site.

8. Responsibility summary

Capability Responsible component
Sign-in email and passwordMicrosoft Entra External ID
MFA and identity policiesMicrosoft Entra External ID
Portal sessionMicrosoft Power Pages
Identity-to-Contact associationPower Pages external identity configuration and Dataverse
Record and page accessPower Pages roles, page permissions, and Dataverse table permissions
User profile emailDataverse Contact
Custom sign-in email updateServer-side solution process using Microsoft Graph

Confirm final field mappings, permissions, identity claims, and operational ownership against the approved Power Pages solution design.

No comments:

Post a Comment