cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michael_Cullen
Frequent Visitor

Cannot configure Portal to work with AD B2C

I am trying to configure my PowerApps Portal to work with an AD B2C identity provider instance. My current configuration settings are shown in the attached screenshots.

 

IdentityProviderConfiguration.png

 

Azure AD B2C Configuration.png

When a user logs in through the AD B2C instance, they are redirected to the Portal, but are not logged into it. I have confirmed that the user exists in the identity provider, and also that they exist in the Dataverse on which the Portal is based. I have examined the token sent from AD B2C in jwt.ms, as shown in the third attached screenshot below:

 

token as shown in jwt.mstoken as shown in jwt.ms

 

I would have expected the user to be logged in, based on the information contained in the userDetails. What exactly does the Portal need to find in the token in order to log the user in?

 

(Note: there is a contact in the Dataverse with the same username and email as received in the token.)

2 REPLIES 2
chleverenz
Super User
Super User

Hi @Michael_Cullen ,

does your user (contact) have an external identity, which maps thios contact to your identity provider?

When logging in with your external provider, the portal looks into the external identities to fiund a match for the combination of the identity provider and the user (usually a guid) and takes the looked up contact from that entry as a logged in user.

 

Usually, the user can log in with his local account and then connect this account with your azure b2c. You can also set up, that the contact is created by signing up via azure b2c.

 

Hope this helps,

  Christian

Hi @chleverenz ,

That did help, thanks! It turned out the identity provider was not set up correctly - the sub field did not contain the correct information. Once we changed it so that the contactid field of the Contact table was placed in the sub field, the portal was able to identify the user and log them in.

 

Thanks,

Michael

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Users online (1,946)