docker-compose environment for the entire v.st system https://v.st/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
env/keycloak/create-user

32 lines
605 B

#!/bin/bash
die() { echo >&2 "$@" ; exit 1 ; }
PATH=$PATH:/opt/local/keycloak/bin
USERNAME="$1"
EMAIL="$2"
if [ -z "$USERNAME" ] || [ -z "$EMAIL" ]; then
die "usage: $0 username email"
fi
ID=$(kcadm.sh create users \
-r $REALM \
-s enabled=true \
-s "username=$USERNAME" \
-s "email=$EMAIL" \
)
if [ -z "$ID" ]; then
die "$USERNAME: unable to create"
fi
echo "$USERNAME: $ID"
echo -n '["UPDATE_PASSWORD"]' | \
kcadm.sh update \
"users/$ID/execute-actions-email" \
-r $REALM \
-q client_id=hedgedoc \
-q redirect_uri="https://${HEDGEDOC_HOSTNAME}.${DOMAIN_NAME}/s/Getting_started" \
-f -