Send error from Registration Inline hook to Widget and show in UI

Hello
I have a registration inline hook that connects to our API to perform validations
If I want to return an error due to an invalid value in one attribute, what format should it be in order for the Widget to get it?
Currently I see in this call https://splunk-ext-poc.okta.com/idp/idx/enroll/new the messages attribute saying:

"messages": {
        "type": "array",
        "value": [
            {
                "message": "Se ha producido un error al crear la cuenta. Intente registrarse de nuevo.",
                "i18n": {
                    "key": "registration.error.generic",
                    "params": []
                },
                "class": "ERROR"
            }
        ]
    },

But it does not include my custom error
I’m trying to return a Commands object with the custom error like this:

{
    "commands": [
        {
            "type": "com.okta.user.profile.update",
            "value": {
                "error": {
                    "reason": "CUSTOM_REASON_CODE",
                    "message": "Your custom validation message here"
                }
            }
        }
    ],
    "statusCode": 500
}

But the widget still receives the generic error message

Does anyone know where I could find more info?

The fields you’ve included in your response don’t look quite right. Can you try changing yours to match what we have in our docs here (in the examples in the right-most panel, where an errorSummary is returned instead of a `message:

{
  "commands": [
    {
      "type": "com.action.update",
      "value": {
        "registration": "DENY"
      }
    }
  ],
  "error": {
    "errorSummary": "Incorrect email address. Please contact your admin.",
    "errorCauses": [
      {
        "errorSummary": "Only example.com emails can register.",
        "reason": "INVALID_EMAIL_DOMAIN",
        "locationType": "body",
        "location": "data.userProfile.email",
        "domain": "end-user"
      }
    ]
  }
}
1 Like

Thank you so much Andrea
I was sending a 400 statusCode back but now I see it’s expecting a 200 response.
It’s working now :100:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.