Managing external identities to enable secure access for partners, customers, and other non-employees
Azure AD B2C - ASP.Net Core Angular Application - Error while acquiring token for downstream Web API
I have a SPA that uses Azure AD B2C and MSAL libraries. SPA is part of a ASP.Net Core Angular Application. So, the application has .Net Controller that connects to the other azure hosted Web APIs. When angular code makes a HTTP call to the controller, MSAL interceptor kicks in and sends the token across. But, when I try to get the token using tokenAcquisition.GetAccessTokenForUserAsync, I get error. Can you please advise what is going wrong here.
I have followed this code sample on GitHub
fail: Microsoft.Identity.Web.TokenAcquisition[0]
Microsoft.Identity.Web.TokenAcquisition: Error: False MSAL 4.54.1.0 MSAL.NetCore .NET 7.0.4 Darwin 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64 [2023-06-10 05:37:32Z - 867a5621-fbcc-4cd4-8533-692ba502c3de] Exception type: Microsoft.Identity.Client.MsalUiRequiredException
, ErrorCode: user_null
HTTP StatusCode 0
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
A cloud-based identity and access management service for securing user authentication and resource access