In 2022 we setup a custom template for the New Universal Login Experience. It’s pretty simple, just some marketing copy and the required {%- auth0:widget -%} in the body and {%- auth0:head -%} in head of the page. I tried to update it today via the doc form and curl and always get this error:
{
“statusCode”: 400,
“error”: “Bad Request”,
“message”: “Payload validation error: ‘Data does not match any schemas from ‘oneOf’’.”,
“errorCode”: “invalid_body”
}
I even get this if I GET the current template and send it back up. What am I doing wrong?
Verify that the page template is smaller than 102,400 characters.
There may be other use cases where this error happens due to a JSON payload that doesn’t work well with the set template API .
The best way to recover from this state is to delete the template and set a new template using an HTML payload. As documented in the API explorer, set template API supports HTML payload using content-type set to text/html.
Ok I DID get this to work by using text/html content type and curl.
For example:
curl -L -i -X PUT ‘AUTH0_APP_URL/api/v2/branding/templates/universal-login’
-H ‘Content-Type: text/html’
-H ‘Authorization: Bearer AUTH_TOKEN’
–data-raw ‘HTML GOES HERE’
There must be some issue with the json parsing here (not surprising since it’s asking you to shove a LOT of html into a json field, but hope this helps someone else because the docs don’t really cover this with a working example.