Reputation: 71
I have tried to use api connectors in sign-up flow, But it's not working.
I have tried following
(1) Api Connectors registration :
(2) Linked api connectors in sign-up flow (Before creating the user)
(3) End point (API)
** I am not using parameter values in api, returning static status result. Just for testing purpose.
[HttpPost]
public async Task<IActionResult> Post()
{
using (StreamReader stream = new StreamReader(HttpContext.Request.Body))
{
Task<string> body = stream.ReadToEndAsync();
return new BadRequestObjectResult(
new ResponseContent("ShowBlockPage", "You are blocked by authority"));
}
}
Upvotes: 0
Views: 472
Reputation: 11315
It is working as expected, you’re returning a bad request HTTP code, without a properly formed response to show the friendly error.
Here is an example error response: https://github.com/azure-ad-b2c/samples/blob/master/policies/relying-party-rbac/source-code/AADB2C.RBAC.Sample/AADB2C.RBAC.Sample/Controllers/IdentityController.cs#L34
Carefully examine the b2crsponsemodel model and mimic its behaviour.
More info here https://learn.microsoft.com/en-us/azure/active-directory-b2c/restful-technical-profile#returning-validation-error-message
Upvotes: 1