Skip to content

Commit

Permalink
add script for creating users
Browse files Browse the repository at this point in the history
  • Loading branch information
markdboyd committed Mar 20, 2024
1 parent 5a50821 commit 4ec37ed
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions uaa/add-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

if [ "$#" -lt 1 ]; then
echo
echo "Usage:"
echo " $ ./add-user.sh <EMAIL_ADDRESS>"
echo
exit 1;
fi

if ! hash uaac 2>/dev/null; then
echo -n "uaac must be installed"
exit 1
fi

EMAIL=$1
ORIGIN=$(awk -F '@' '{print $2}' <<< "$EMAIL")

echo -n "Adding user ${EMAIL}... "
uaac curl \
-X POST /Users \
-H "If-Match:*" \
-H "Accept:application/json" \
-H "Content-Type:application/json" \
-d \{\"userName\":\""${EMAIL}"\",\"emails\":[\{\"value\":\""${EMAIL}"\"\}],\"active\":true,\"verified\":true,\"origin\":\""${ORIGIN}"\"\}

0 comments on commit 4ec37ed

Please sign in to comment.