Curl: (6) could not resolve host

Hi,
When I create a new API and then try to get a token from it through cUrl like this
curl --request POST
–url https://dev-uswrsjid.us.auth0.com/oauth/token
–header ‘content-type: application/json’
–data ‘{“client_id”:“6AUMmEzcmCWtMc1O72gQHnVhrIUR11gs”,“client_secret”:“dxNnovSaR6S2yJw4HKfi2nSWRaOLA7pykqcokOAJHXGsj24GSV25qN106z5MWOA5”,“audience”:“http://localfood.fun”,“grant_type”:“client_credentials”}’
I get this error
curl: (6) Could not resolve host:
Any idea what the problem might be?
Thanx,
Maria

Hi!

I was unable to get your curl command to work.
I generated one from PostMan and this works:

url --location --request POST 'https://dev-uswrsjid.us.auth0.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=6AUMmEzcmCWtMc1O72gQHnVhrIUR11gs' \
--data-urlencode 'client_secret=dxNnovSaR6S2yJw4HKfi2nSWRaOLA7pykqcokOAJHXGsj24GSV25qN106z5MWOA5' \
--data-urlencode 'audience=http://localfood.fun”'

You will need to enable the client for the API in the Auth0 dashboard, I got “service not enabled” but the curl command above works.

It would be a good idea to create a new Client or rotate the secret on the existing client since the ID and secret were shared publicly.

Hope this helps!

1 Like

Thanks for helping on this one Marcus!