From 9f25018663685eabb5af1273277eac9a0b308c7b Mon Sep 17 00:00:00 2001 From: lukasmatusiewicz Date: Mon, 25 Nov 2024 11:00:28 +0100 Subject: [PATCH] Update PrivacyIDEA.java fix params map in pi request --- src/main/java/org/privacyidea/PrivacyIDEA.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/privacyidea/PrivacyIDEA.java b/src/main/java/org/privacyidea/PrivacyIDEA.java index 85ec839..53ca25a 100644 --- a/src/main/java/org/privacyidea/PrivacyIDEA.java +++ b/src/main/java/org/privacyidea/PrivacyIDEA.java @@ -235,10 +235,9 @@ public boolean pollTransaction(String transactionID) { Objects.requireNonNull(transactionID, "TransactionID is required!"); - String - response = - runRequestAsync(ENDPOINT_POLLTRANSACTION, Collections.singletonMap(TRANSACTION_ID, transactionID), Collections.emptyMap(), - false, GET); + Map params = new LinkedHashMap<>(); + params.put(TRANSACTION_ID, transactionID); + String response = runRequestAsync(ENDPOINT_POLLTRANSACTION, params, Collections.emptyMap(), false, GET); PIResponse piresponse = this.parser.parsePIResponse(response); return piresponse.value; } @@ -290,8 +289,9 @@ public List getTokenInfo(String username) error("Cannot retrieve token info without service account!"); return null; } - - String response = runRequestAsync(ENDPOINT_TOKEN, Collections.singletonMap(USER, username), new LinkedHashMap<>(), true, GET); + Map params = new LinkedHashMap<>(); + params.put(USER, username); + String response = runRequestAsync(ENDPOINT_TOKEN, params, new LinkedHashMap<>(), true, GET); return parser.parseTokenInfoList(response); } @@ -372,7 +372,7 @@ private String runRequestAsync(String path, Map params, Map callable = new AsyncRequestCallable(this, endpoint, path, params, headers, authTokenRequired, method); Future future = threadPool.submit(callable);