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?
Hi @bengarvey
Welcome to the Auth0 Community!
Thank you for posting your question. I’ve checked our documentation and found this article that addresses the error that you are getting while updating the Universal Login Template → HTTP 400 when patching /api/v2/branding/templates/universal-login
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.
Thanks
Dawid
1 Like
Definitely way under 102K characters. It was around 16,000.
“JSON payload that doesn’t work well”
It’s the same one I set up in 2022.
Would really prefer not to delete it since I have no assurance I can get back to the current state.
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.