Skip to content

Instantly share code, notes, and snippets.

@claudijd
Created April 16, 2019 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudijd/a911d558b0eb8e8537da18c291a101a3 to your computer and use it in GitHub Desktop.
Save claudijd/a911d558b0eb8e8537da18c291a101a3 to your computer and use it in GitHub Desktop.
Script to poll app_metadata and group membership
#!/usr/bin/env bash
# Pass in your BEARER_TOKEN to this script to make it dance
mkdir -p ./testing
while true; do
echo "$(date): Polling /api/v2/users/ad%7CMozilla-LDAP%7Cjclaudius and dumping app_metadata and groups to file"
curl -H "Authorization: Bearer $BEARER_TOKEN" "https://auth.mozilla.auth0.com/api/v2/users/ad%7CMozilla-LDAP%7Cjclaudius" 2> /dev/null | jq -r '"\(.app_metadata)|\(.groups)"' > ./testing/$(date +%s)
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment