Skip to content

Instantly share code, notes, and snippets.

@topdodo
topdodo / auth0_add_scopes.sh
Created September 19, 2021 10:48
Auth0 Add Scopes
MGMT_API_ACCESS_TOKEN="<JWT>"
GET_SCOPES=$(curl -s \
--header "authorization: Bearer ${MGMT_API_ACCESS_TOKEN}" \
--header 'cache-control: no-cache' \
"https://${MY_AUTH0_DOMAIN}/api/v2/resource-servers")
GET_SCOPES_BACKUP_FILE="api_scopes_backup_${MY_API_ID}_$(date +'%Y-%m-%d_%H-%M-%S').json"
echo "${GET_SCOPES}" > "${GET_SCOPES_BACKUP_FILE}"
SCOPES_COUNT=$(cat "${GET_SCOPES_BACKUP_FILE}" | jq length)