Azure B2C Custom Policy Calling Web API in Main Tenant

Kyle Infante 0 Reputation points
2024-10-17T16:31:32.4666667+00:00

Description:

I am having trouble trying to configure an HTTP Request from my B2C Custom Policy that will perform a person-lookup against user input. The trickier part is that the B2C Custom Policy will need to perform the HTTP request on our company's main tenant because the app is a proxy app that calls our main private API through VPN Gateway. The VPN Gateway is only configured in our main tenant. I have spent the week trying different methods of approach with no luck. Due to my limited knowledge of Azure, it makes it even more difficult for me.

If I am understanding this correctly, I need to have my Custom Policy call a B2C Tenant's app registration to retrieve an access token. Then utilize that access token to call an App Registration that is in my main tenant where the Web API is running as an App Service? So my main app registration needs to grant permissions for my B2C app registration to make requests?

Current Structure

  • B2C Tenant
    • SIGNUP Custom Policy
    • 'ClientApp' App Registration (get access token)
  • Main Tenant
    • Web API App Registration (use access token)
    • Web API AppService

Both app registrations are set for Multi-tenant because these are cross tenant interactions but other than that, I am not sure about the configurations or how the flow should really be going.

I would greatly appreciate your assistance in resolving this issue. If you could provide any insights into why I might be encountering this internal error and what steps I can take to successfully obtain an access token, it would be immensely helpful.

Thank you for your support.

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,543 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,903 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.