Skip to content

Instantly share code, notes, and snippets.

@shayaantx
Created October 8, 2024 18:13
Show Gist options
  • Save shayaantx/efa398c34c0fd4ebd9f2af421db55cd2 to your computer and use it in GitHub Desktop.
Save shayaantx/efa398c34c0fd4ebd9f2af421db55cd2 to your computer and use it in GitHub Desktop.
get-auth0-connections.bash
echo -e "\nPlease enter your Auth0 credentials:\n"
read -sp "Enter your Client ID: " CLIENT_ID
echo -e "\n"
read -sp "Enter your Client Secret: " CLIENT_SECRET
echo -e "\n"
read -sp "Enter your Domain: " DOMAIN
echo -e "\n"
TOKEN=$(curl --request POST \
--url "https://$DOMAIN/oauth/token" \
--header 'content-type: application/json' \
--data "{
\"client_id\": \"$CLIENT_ID\",
\"client_secret\": \"$CLIENT_SECRET\",
\"audience\": \"https://$DOMAIN/api/v2/\",
\"grant_type\": \"client_credentials\"
}" | jq -r .access_token)
curl --request GET \
--url "https://$DOMAIN/api/v2/connections" \
--header "Authorization: Bearer $TOKEN" \
--header 'Content-Type: application/json' | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment