Skip to content

Instantly share code, notes, and snippets.

@BrianEnigma
Created August 27, 2015 20:35
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 BrianEnigma/d715fbf12e83690286f1 to your computer and use it in GitHub Desktop.
Save BrianEnigma/d715fbf12e83690286f1 to your computer and use it in GitHub Desktop.
Test script to auth against an Elemental box
#!/bin/bash
#URL=/live_events?filter=archived
URL=/live_events
USER=admin
KEY=1acpJN7oEDn3BDDYhQ
NOW=`date +%s`
EXPIRES=$(expr $NOW + 30)
SUBHASH=`echo -n "$URL$USER$EXPIRES" | md5`
HASH=`echo -n "$KEY$SUBHASH" | md5`
echo "URL: $URL"
echo "User: $USER"
echo "Key: $KEY"
echo "Now: $NOW"
echo "Expires: $EXPIRES"
echo "Subhash: $SUBHASH"
echo "Hash: $HASH"
curl -H "Accept: application/xml" \
-H "X-Auth-Expires: $EXPIRES" \
-H "X-Auth-Key: $HASH" \
'http://bart/live_events?filter=archived'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment