I am following this guide
https://docs.microsoft.com/en-us/azure/active-directory-b2c/rest-api-claims-exchange-dotnet
However the code has been deprecated - IHttpActionResult no longer exists in latest version of Net Core
That means this response type now highlights as an error
if (inputClaims.firstName.ToLower() == "test")
{
return Content(HttpStatusCode.Conflict, new B2CResponseContent("Test name is not valid, please provide a valid name", HttpStatusCode.Conflict));
}
I believed that the method should become an ActionResult and return like this instead
if (inputClaims.firstName.ToLower() == "test")
{
return Ok(new B2CResponseContent("Test name is not valid, please provide a valid name", HttpStatusCode.Conflict));
}
However, it appears if I do this, the policy simply ignores the error and carries on registering the user.