Getting 413 when making OAuth access token call


Description

When making a request to Instance to get the OAuth token server is returning 413 response and OAuth call is failing

Release or Environment

All

Cause

OAuth Token call content-type will be application/x-www-form-urlencoded and that content type should have a max payload is 2 MB, if it exceeds more than that then the OAuth call fails with 413 and We won't even see an error in application node logs and the error is returned from Tomcat Server.

Resolution

* Please avoid sending any payload along with Access token request call

* Normally when we are making the OAuth call there is no need to send the payload, we just need Client ID, Client Secret, and Refresh token.

* if still, you need to send Payload with OAuth access token request then make sure the payload should not exceed 2 MB

* But by default for normal Scripted REST API we accept 25 MB of payload since the Content-Type for this will be different