From c807838455b88cabe5b8a78d1032462d8c47d76b Mon Sep 17 00:00:00 2001 From: Galindo97 Date: Wed, 20 May 2026 13:31:55 -0500 Subject: [PATCH] =?UTF-8?q?fix(jenkins):=20mejorar=20diagn=C3=B3stico=20de?= =?UTF-8?q?=20error=20401=20en=20verificaci=C3=B3n=20de=20Keycloak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HTTP 401 indica credenciales inválidas o Direct Access Grants deshabilitado, no que Keycloak sea inaccesible. El mensaje ahora diferencia ambos casos y da instrucciones específicas para resolverlo. Co-Authored-By: Claude Sonnet 4.6 --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d86812ee..26629fb1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -229,8 +229,13 @@ pipeline { -d "grant_type=password&client_id=anexo76-frontend&username=${E2E_TEST_USER}&password=${E2E_TEST_PASSWORD}&scope=openid" \ 2>/dev/null || echo "000") echo "Keycloak token endpoint → HTTP ${KC_STATUS}" - if [ "$KC_STATUS" != "200" ]; then - echo "ERROR: Keycloak no accesible o password grant no habilitado (HTTP ${KC_STATUS})." + if [ "$KC_STATUS" = "401" ]; then + echo "ERROR 401 — Credenciales inválidas o Direct Access Grants deshabilitado." + echo " Verifica en Keycloak: Clients → anexo76-frontend → Settings → Direct access grants = ON" + echo " Verifica que el usuario '${E2E_TEST_USER}' exista en el realm y la contraseña sea correcta." + exit 1 + elif [ "$KC_STATUS" != "200" ]; then + echo "ERROR: Keycloak no accesible (HTTP ${KC_STATUS})." echo "URL: ${KC_TOKEN_EP}" exit 1 fi