diff --git a/goofy-client/apps/goofy-e2e/Jenkinsfile b/goofy-client/apps/goofy-e2e/Jenkinsfile index 595ca539a047f221335dc4226d603a9b614e2a23..6cf3ad53c272f1997b0095b7e3124851f4cc5d2f 100644 --- a/goofy-client/apps/goofy-e2e/Jenkinsfile +++ b/goofy-client/apps/goofy-e2e/Jenkinsfile @@ -720,6 +720,14 @@ String getKeycloakUuid(realm, userName) { } } +String getKeycloakAccessToken(String realm) { + userManagerApiUserCredentials = getUserManagerApiUserCredentials(realm) + + def token = readJSON text: sh (script: "set +x && curl -d \"client_id=admin-cli\" -d \"username=${userManagerApiUserCredentials.user}\" -d \"password=${userManagerApiUserCredentials.password}\" -d \"grant_type=password\" https://$SSO_URL/realms/$realm/protocol/openid-connect/token", returnStdout: true) + + return token.access_token +} + Map getUserManagerApiUserCredentials(String namespace) { userManagerApiUserCredentials = readJSON ( text: sh (script: "kubectl get secret usermanagerapiuser-credentials -n ${namespace} -o jsonpath={.data}", returnStdout: true)) @@ -729,14 +737,6 @@ Map getUserManagerApiUserCredentials(String namespace) { ] } -String getKeycloakAccessToken(String realm) { - userManagerApiUserCredentials = getUserManagerApiUserCredentials(realm) - - def token = readJSON text: sh (script: "set +x && curl -d \"client_id=admin-cli\" -d \"username=${userManagerApiUserCredentials.user}\" -d \"password=${userManagerApiUserCredentials.password}\" -d \"grant_type=password\" https://$SSO_URL/realms/$realm/protocol/openid-connect/token", returnStdout: true) - - return token.access_token -} - Void sendFailureMessage() { def data = [ "msgtype": "m.text",