On Boarding User External user to tenant through Powerapps portal

In this blog post we are going to cover the aspects of inviting a new user or an external user to Azure Ad and on board to the Customer Portal.

With this feature you can

  1. Add external user to the Azure AD.
  2. Add external user to the Customer portal.
  3. Send invitation emails to the end user on provisioning of a Customer portal.

Setup Site Settings in the Customer portal

In the Customer portal setting, set site setting AllowContactMappingWithEmail value to true. This allows a staff member to register on the portal using Azure AD and be connected to an existing contact record.

Create Entity to Track Request

We will have custom entity called UserOnBoardingRequest entity with fields first name, last name, Email Address and Invite Status.

Invite status is an option set with values Queued, Pending Acceptance, Accepted or Rejected Status.

We will have form in PowerApps Portal to add record for UserOnBoardingRequest, this would be the entity to keep track of users that are added through the portal,

Create Flows

For Onboarding user to Azure AD tenant we need to setup or create below flows.

  1. Triggered flow “When a User On Boarding Record is updated -> Send User Invitation”
  2. Scheduled or Recurrence flow “Recurrence Pending Acceptance Check -> List records”

Flow 1 “When a User On Boarding Record is updated -> Send User Invitation”

Flow gets triggered if the invitation status gets updated and set to Queued status. Flow performs below

  1. Check if user exists and Provisioned, Update the request status to Accepted state.
  2. If User does not exist or guest invitation rejected state, flow sends out Invitation request

Configure a New flow with CDS Update Triggered flow for UserOnBoardingRequest entity on invitation status change field as below.

We need to check if the user already exists, for this we need to Create a http request action to check if user exists as below

This is a graph call with parameter or filter as email address, this will return User information if exists.

If user information is returned, check the exteranlUserState response value to see if user accepted the Guest invite, if yes update the request to the Acceptance state. End the flow

If not send invite to the guest user email address using httprequest action in the flow as below

While calling the invitation action, we are passing the display name which is combination of first and last name, email address and redirect url as well.

Post the successful invite send Update the status of the request to PendingAcceptance.

Flow 2 “Recurrence Pending Acceptance Check -> List records”

Flow frequently checks for all request that are in pending acceptance status, for each of the request that are in pending status it would perform Micrsoft graph api call to check if user is Accepted or Rejected state. Accordingly the request is updated to the Accepted or Rejected state.

Create a Recurrence or Scheduled flow as below

Fetch all the request that are in pending acceptance check ,

for each of the request check the status of guest invite status by performing graph call.

Check the response of the flow externalUserState if state is Accepted or Rejected accordingly update the user on boarding request with the Accepted or Rejected state.

If Accepted

Create a contact record with the first name,last name and email address to provision user for customer portal

Execution

We will have form in PowerApps Portal to add record for User      OnBoardingRequest

  1. Existing or admin User will create a UserOnBoardingRequest record by filling up first name, last name and email address. 
  2. User clicks submit. On click of submit the record will be created with Invite Status will be set to Queued.

“When a User On Boarding Record is updated -> Send User Invitation” will get executed, guest invite email will be sent to the email address.

New user will accept the guest invite with mentioned email address.

Recurrence flow will check for the user Acceptance, if Accepted user will be provisioned to the Customer Portal as well.

- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -

Latest News

How a robust Power Apps solution orchestrates thousands of project implementations

Managing moving parts is hard, and it’s costly to fumble big projects Struggles with monitoring project health can be perilous....
- Advertisement -

More Articles Like This

- Advertisement -