Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
Issue #68
  • Loading branch information
rsoika committed Sep 13, 2022
1 parent 91489e3 commit 4dc48c7
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import java.util.logging.Logger;

import org.imixs.melman.BasicAuthenticator;
import org.imixs.melman.CookieAuthenticator;
import org.imixs.melman.EventLogClient;
import org.imixs.melman.FormAuthenticator;
import org.imixs.melman.JWTAuthenticator;
import org.imixs.melman.ModelClient;
import org.imixs.melman.RestAPIException;
import org.imixs.melman.WorkflowClient;
Expand All @@ -19,6 +21,7 @@
import jakarta.inject.Named;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.ws.rs.client.ClientRequestFilter;
import jakarta.ws.rs.core.Cookie;

/**
* The ConnectionController stores the connection data to an Imixs Workflow
Expand Down Expand Up @@ -185,6 +188,16 @@ public WorkflowClient getWorkflowClient() {
workflowClient.registerClientRequestFilter(formAuth);

}
if ("COOKIE".equals(getType())) {
logger.info("..set authentication cookie: name=" + getKey() + " value=....");
Cookie cookie = new Cookie(getKey(), getToken());
CookieAuthenticator cookieAuth = new CookieAuthenticator(cookie);
workflowClient.registerClientRequestFilter(cookieAuth);
}
if ("JWT".equalsIgnoreCase(getType())) {
JWTAuthenticator jwtAuht = new JWTAuthenticator(getToken());
workflowClient.registerClientRequestFilter(jwtAuht);
}
}

return workflowClient;
Expand Down

0 comments on commit 4dc48c7

Please sign in to comment.