Skip to content

Commit f367116

Browse files
committed
one more fix
Signed-off-by: Dmitrii Tikhomirov <[email protected]>
1 parent 0f358b6 commit f367116

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/AccessTokenProvider.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ public class AccessTokenProvider {
4545

4646
public JWT validateAndGet() {
4747
Map<String, Object> token = tokenResponseHandler.apply(invocation, context);
48-
JWT jwt;
49-
try {
50-
jwt = jwtConverter.fromToken((String) token.get("access_token"));
51-
} catch (IllegalArgumentException e) {
52-
throw new IllegalStateException("Failed to parse JWT token: " + e.getMessage(), e);
53-
}
48+
JWT jwt = jwtConverter.fromToken((String) token.get("access_token"));
5449
if (!(issuers == null || issuers.isEmpty())) {
5550
String tokenIssuer = (String) jwt.getClaim("iss");
5651
if (tokenIssuer == null || tokenIssuer.isEmpty() || !issuers.contains(tokenIssuer)) {

impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/oauth/TokenResponseHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.serverlessworkflow.impl.WorkflowException;
2121
import jakarta.ws.rs.ProcessingException;
2222
import jakarta.ws.rs.client.ResponseProcessingException;
23+
import jakarta.ws.rs.core.GenericType;
2324
import jakarta.ws.rs.core.Response;
2425
import java.util.Map;
2526
import java.util.function.BiFunction;
@@ -41,7 +42,7 @@ public Map<String, Object> apply(InvocationHolder invocation, TaskContext contex
4142
+ response.getEntity())
4243
.build());
4344
}
44-
return (Map<String, Object>) response.readEntity(Map.class);
45+
return response.readEntity(new GenericType<>() {});
4546
} catch (ResponseProcessingException e) {
4647
throw new WorkflowException(
4748
WorkflowError.communication(

0 commit comments

Comments
 (0)