Troubleshooting "Unauthorized" errors when calling Azure API Management with B2C

hampton123 1,175 Reputation points
2023-07-19T16:29:41.5333333+00:00

Currently I've been following this tutorial to integrate Azure API Management with B2C: https://learn.microsoft.com/en-us/azure/api-management/howto-protect-backend-frontend-azure-ad-b2c.

I have the system for B2C working, however when I call the API through pressing the "Call API" button after logging in, I receive an error "GET {API link}" 404 (Not Found)". When I load the API link in the next tab, it states a 401 unauthorized status code. I'm not sure how to address this issue.

Please let me know if I need to provide any additional context.

EDIT: I neglected to mention that the HTML itself states "SyntaxError: Unexpected end of JSON input" as the error. The 404 GET error is from inspecting the page and looking into the error.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
Microsoft Security Microsoft Entra Microsoft Entra External ID
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-08-09T15:35:47.98+00:00

    Hunter B Thanks for your patience and sharing it with us.

    Update for the community:

    Initially when following the tutorial, App registrations were not created under Azure AD B2C. Then after assigning necessary permissions and troubleshooting, Hunter B figured out that Azure Function name was created incorrectly i.e., HttpTrigger1 vs hello in the tutorial. Hence, the API call was made incorrectly and returned the above error.

    He corrected the function name and it worked successfully.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.