Azure AD B2C - API Connector - 400 Bad Request: There was a problem processing your request. Please try again.

Dan
6
Reputation points
Hi,
I'm getting a 400 - Bad Request with response body
{"errorMessage":"There was a problem processing your request. Please try again.","httpStatus":"400","numberOfAttempts":1}
'before creating the user' as part of the built in user flow. The Api Connector is pointing to an Azure Function.
I'm seeing the 400 within App Insights, but it's not actually hitting the function method, i.e. this error message appears to be generated by Azure.
Calling the Azure Function manually via Postman works fine.
Any ideas on how to solve this problem?
Thank you
1 vote
Hi Marilee,
Thank you for your reply. It happens when I try to sign up a new user and calls my custom API connector, so not sure how it's related to a token since I don't think one is generated yet.
If it helps, in my AAD B2C audit logs I get:
Activity Type
An API was called as part of a user flow
Correlation ID
7a89b7fd-305f-410d-a18e-a96701086482
Status
failure
Status reason
N/A
To be specific I'm using Isolated Azure functions with .NET. Do you know the http request header limits? According to Postman the request header size is over 7kb.
did you find a resolution to this? i'm getting the same error and cannot determine a solution. the api method is working fine in postman, so i have to have something set up incorrectly for b2c access, but i'm not sure what it is.
this is the format of my api method:
[HttpPost]
public ActionResult AuthorizeUser([FromBody] JsonElement body)
@Dan
I have looked up logs for correlation ID that you had shared. As per the log below is the error that I see,
InvalidResponseException: at Web.TPEngine.Providers.RestfulProvider.<GetClaimsFromProviderAsync>d__48.MoveNext() in C:__w\1\s\src\Production\Web.TPEngine\Providers\RestfulProvider.cs:line 1264
Web.TPEngine.Providers.BadArgumentRetryNeededException: ErrorCodes: AADB2C90075
As per the error code AADB2C90075, error message is The claims exchange '{0}' specified in step '{1}' returned HTTP error response with Code '{2}' and Reason '{3}'.
No resolution yet unfortunately.
Thanks, so this looks like an issue outside of my Azure Function. Should I raise a GitHub ticket, if so which repository?
Also, do you have the values for 0,1,2 and 3 in the log message?
@Sandeep G-MSFT I have same issue in custom policy we using api calls and sometimes it return
{
"error": "server_error",
"error_description": "AADB2C90075: The claims exchange 'Get-Permissions' specified in step '3' returned HTTP error response with Code 'NotFound' and Reason 'Site Not Found'.\r\nCorrelation ID: 913e0f71-5950-4b6e-9cea-5206ee00d4ff\r\nTimestamp: 2022-09-30 10:42:32Z\r\n"
}
Sign in to comment