Azure B2C API connector failed to connect to Power Automate flow

Power Coder 0 Reputation points
2024-09-09T11:16:54.38+00:00

I want to add an API connector in my SignIn & SignUp user flow.

I have created a HTTP-triggered Power Automate. But unfortunately, B2C is unable to call that flow.

It is showing the below message in the logs -

{"errorMessage":"There was a problem processing your request. Please try again.","httpStatus":"401","numberOfAttempts":1}


I have also tried to create an Azure function. It is working fine.

Not sure if it is something from the Power Automate side or what.

I am following the below documentation.

https://learn.microsoft.com/en-us/azure/active-directory-b2c/add-api-connector

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,622 questions
{count} votes

2 answers

Sort by: Most helpful
  1. James Hamil 26,386 Reputation points Microsoft Employee
    2024-09-12T20:00:21.3766667+00:00

    Hi @Power Coder , the 401 shows that this is due to authentication. Can you please check the following for me?

    • Verify that the authentication type configured for your API connector matches the authentication method used by your Power Automate flow. If your flow requires a specific authentication token, make sure it is correctly configured in the API connector settings.
    • Make sure that the endpoint URL for your Power Automate flow is correctly specified in the API connector configuration. Any discrepancies in the URL can lead to connection failures.
    • Check the permissions and access rights for the Power Automate flow. Ensure that the flow has the necessary permissions to be called by the Azure AD B2C API connector.

    Please let me know your results and I can help you further!

    Best,

    James


  2. Power Coder 0 Reputation points
    2024-12-21T05:36:43.77+00:00

    Tldr; Power Automate flow will not work with the B2C API connector.

    The problem I found is that the Power Automate flow uses a token or signature for authentication (see extra parameters in the flow URL).

    However, the B2C connector tries to authenticate with the Basic Auth method.

    And the flow returns the status 401 Unauthorized.

    Try calling the flow using Postman and add the Basic Auth method with any username and password. It will return the following error.

    {
        "error": {
            "code": "DirectApiRequestHasMoreThanOneAuthorization",
            "message": "The request has SAS authentication scheme, 'Basic' authorization scheme or internal token scheme. Only one scheme should be used."
        }
    }
    
    0 comments No comments

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.