First login fail

Hi,
After manually creating a new user the following always happens only on the first login try:

curl --request POST \
  --url '...' \
  --header 'content-type: application/json' \
  --data '{"grant_type":"password", "client_id":"...", "client_secret":"...", "username":"dummy@example.com", "password":"...", "audience":"..."}'

Response:

{"error":"access_denied","error_description":"Cannot read property 'prompt' of undefined"}

Second time for the SAME curl command works!

ANy ideas???

Hi @roy2,

Thanks for reaching out to the Auth0 Community!

After observing your CURL command, I noticed that your header should be URL encoded.

For example:

curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=password \
  --data username=user@example.com \
  --data password=pwd \
  --data audience=YOUR_API_IDENTIFIER \
  --data scope=read:sample \
  --data 'client_id=YOUR_CLIENT_ID' \
  --data client_secret=YOUR_CLIENT_SECRET

Regarding the response, it can happen when you have a Rule or Action checking for a condition that includes the “prompt” property.

If this is the case, you will have to adjust your Rule/Action in the auth pipeline to accommodate this check.

Hoped this helps!

Please let me know if you have any further questions.

Thank you.