I’m working on a React application that is hosted on Azure Static Web Apps, and I want to implement managed identity for authentication. I’ve read through the Azure documentation, but I’m having trouble figuring out the exact steps to set this up.
Current Setup:
My React app is deployed to Azure Static Web Apps.
I have configured the Azure Static Web App and added the necessary roles for managed identity.
How do I configure my React app to use managed identity for authentication on Azure Static Web Apps?
What is the correct way to retrieve and use the managed identity token in a React application?
Any guidance or examples would be greatly appreciated!
1 : Enabled managed identity for my Azure Static Web App.
Attempted to configure authentication in my React app using the @azure/identity library.
Followed the steps in the Azure documentation.
I’m unsure how to correctly retrieve the managed identity token in my React app.
When I try to authenticate, Show Errors
“The current user is not authorized to access this resource.”
** BrowserAuthError: uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API**
Sameer Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.