Umang
Umang

Reputation: 71

Api connectors not working [Before creating the user]

I have tried to use api connectors in sign-up flow, But it's not working.

enter image description here

I have tried following

(1) Api Connectors registration :

enter image description here

(2) Linked api connectors in sign-up flow (Before creating the user)

enter image description here

(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

Answers (1)

Jas Suri - MSFT
Jas Suri - MSFT

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

Related Questions