Hi Community,
I’m working on a solution that involves embedding a React app within a Power Pages site that uses Azure AD B2C authentication. The end goal is to allow the React app to interact with SharePoint data via an Azure Function, using managed identity for secure backend access.
Here’s the intended flow:
User signs in to the Power Pages site using Azure AD B2C.
A custom React app, hosted within the Power Pages site (possibly via iframe or another embedding method), needs to access the user’s authentication token.
The React app sends this token to an Azure Function (HTTP triggered).
The Azure Function validates the token, then uses its managed identity to securely access SharePoint (via Microsoft Graph or SharePoint REST API).
I’m looking for guidance or best practices on the following:
How can I access the Azure AD B2C token from within the embedded React app on Power Pages?
What is the best way to securely pass the token to the Azure Function?
How should the Azure Function validate the token before proceeding with SharePoint access?
Are there any specific CORS, identity provider, or authorization policies I should configure to make this work securely and smoothly?
If anyone has experience or references for a setup involving Power Pages + React + Azure AD B2C + Azure Functions + SharePoint via managed identity, your insights would be incredibly helpful!
Thanks in advance for your support.