Created
August 27, 2015 20:35
-
-
Save BrianEnigma/d715fbf12e83690286f1 to your computer and use it in GitHub Desktop.
Test script to auth against an Elemental box
This file contains 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
#!/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