Skip to content

Commit

Permalink
remove failed idea
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Apr 28, 2025
1 parent ca9b417 commit 66a3e2f
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions config_job.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,6 @@ GRANT
return 1
}
# Function to login to Keycloak admin console
function login {
local token=$(curl -s -X POST "$KC_URL/auth/realms/master/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=$(kc_user)" \
-d "password=$(kc_passwd)" \
-d "grant_type=password" \
-d "client_id=admin-cli" | jq -r '.access_token')
if [ "$token" == "null" ] || [ -z "$token" ]; then
echo "Failed to get access token"
return 1
fi
# Store token for subsequent calls
KC_TOKEN=$token
return 0
}
# Create a new realm
function create_realm {
local realm_name=$1
Expand Down Expand Up @@ -310,13 +291,6 @@ GRANT
# Fix PostgreSQL permissions for metrics
fix_metrics_permissions
# Login to Keycloak
echo "Logging in to Keycloak"
login || {
echo "Failed to login to Keycloak"
exit 1
}
# Step 1: Login and create realm
echo "Step 1: Creating realm"
create_realm ${var.default_realm}
Expand Down

0 comments on commit 66a3e2f

Please sign in to comment.