Skip to content

Instantly share code, notes, and snippets.

@arielweinberger
Created April 29, 2020 19:26
Show Gist options
  • Save arielweinberger/21d3b72bb4f345a410abb7e98a17cc96 to your computer and use it in GitHub Desktop.
Save arielweinberger/21d3b72bb4f345a410abb7e98a17cc96 to your computer and use it in GitHub Desktop.
curl --location --request POST 'https://YOUR_AUTH0_DOMAIN/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=YOUR_AUTH0_CLIENT_ID' \
--data-urlencode 'username=YOUR_USERNAME' \
--data-urlencode 'password=YOUR_PASSWORD' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=openid'
@IvanPKostadinov
Copy link

IvanPKostadinov commented Oct 24, 2023

Here is a working example:

curl --request POST \
--url https://YOUR_AUTH0_DOMAIN/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"YOUR_AUTH0_CLIENT_ID","client_secret":"YOUR_AUTH0_CLIENT_SECRET","audience":"https://YOUR_AUTH0_DOMAIN/api/v2/","username":"YOUR_USERNAME","password":"YOUR_PASSWORD","grant_type":"password"}'

Another option is to use Postman, as mentioned in this comment. Remember to also add your client_secret to the Request body (it is not shown in the comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment