Created
October 8, 2024 18:13
-
-
Save shayaantx/efa398c34c0fd4ebd9f2af421db55cd2 to your computer and use it in GitHub Desktop.
get-auth0-connections.bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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