Access Denied when using oauth/token

const options = {
method: ‘POST’,
url: ISS_AUTH0_DOMAIN + ‘oauth/token’,
headers: {‘content-type’: ‘application/json’},
data: {
grant_type: ‘’,
client_id: AUTH0_CLIENT_ID,
client_secret: AUTH0_CLIENT_SECRET,
username: body.username,
otp: body.code,
realm: ‘email’,
scope: ‘openid profile email offline_access’

data: {
error: ‘access_denied’,
error_description: “Cannot read property ‘length’ of undefined”

Hi @anton.p,

Welcome to the Auth0 Community!

I understand that you encountered an Access Denied error when making a request to the oauth/token endpoint.

After looking at your request, there is nothing that stands out to me as an issue. However, the error points out that one of the required data passed in the request was undefined.

In this scenario, I recommend printing the data in your request on console to see if there are any undefined values.

Please let me know how this goes for you.

Thank you.