use of org.simbasecurity.client.filter.action.FilterActionFactory in project simba-os by cegeka.
the class SimbaFilter method doFilter.
private void doFilter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain) throws ServletException, IOException {
if (isUrlExcluded(request)) {
chain.doFilter(request, response);
return;
}
RequestData requestData = RequestUtil.createRequestData(request, simbaWebURL, simbeEidSuccessUrl);
FilterActionFactory actionFactory = new FilterActionFactory(request, response, chain);
THttpClient tHttpClient = null;
try {
tHttpClient = new THttpClient(SimbaConfiguration.getSimbaAuthenticationURL());
TProtocol tProtocol = new TJSONProtocol(tHttpClient);
AuthenticationFilterService.Client authenticationClient = new AuthenticationFilterService.Client(tProtocol);
ActionDescriptor actionDescriptor = authenticationClient.processRequest(requestData, authenticationChainName);
actionFactory.execute(actionDescriptor);
} catch (Exception e) {
throw new ServletException(e);
} finally {
if (tHttpClient != null) {
tHttpClient.close();
}
}
}
Aggregations