restructure: flatten scripts dirs, remove roster, update SKILL.md
This commit is contained in:
21
keycloak-hangman-lab/scripts/reset-password
Executable file
21
keycloak-hangman-lab/scripts/reset-password
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
# Get username from secret-mgr
|
||||
username=$(secret-mgr get-username --key keycloak)
|
||||
if [[ -z "$username" ]]; then
|
||||
echo "Error: No username found in secret-mgr for key 'keycloak'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
realm="Hangman-Lab"
|
||||
|
||||
# Generate new password
|
||||
password=$(secret-mgr generate --key keycloak --username "$username")
|
||||
|
||||
# Update password via kcadm
|
||||
"$SCRIPT_DIR/kcadm" set-password -r "$realm" --username "$username" --new-password "$password"
|
||||
|
||||
echo "Password updated for user: $username (realm: $realm)"
|
||||
Reference in New Issue
Block a user