public HTTPClientFactory getHttpClientFactory() { if (httpClientFactory == null) { synchronized (this) { if (httpClientFactory == null) { httpClientFactory = new JDKHTTPClientFactory(); } } } return httpClientFactory; }
/** * Creates a new WSS 1.1 client object. * @param wssUrl URL of the WSS */ public WSS1_1Adapter(URL wssUrl) { this.wssURLString = wssUrl.toExternalForm(); this.httpClientFactory = new JDKHTTPClientFactory(); }
protected HTTPClientFactory getHttpClientFactory(Transferable pRequest) { HTTPClientFactory httpClientFactory = (HTTPClientFactory) pRequest.getAttributeValue(HTTP_CLIENT_FACTORY); if (httpClientFactory == null) { return new JDKHTTPClientFactory(); } return httpClientFactory; }
protected HTTPClientFactory getHttpClientFactory() { HTTPClientFactory clientFactory = (HTTPClientFactory) getSecurityConfig().getPreConfiguredInstance("httpClientFactory"); if (clientFactory == null) { clientFactory = new JDKHTTPClientFactory(); } return clientFactory; } }
httpClientFactory = new JDKHTTPClientFactory();
protected void init(final ServletConfig servletConfig, final ServiceConfig serviceConfig, final SecurityConfig secConfig) { if (serviceConfig.getInstance() instanceof PolicyEnforcementServiceLocator) { m_pesLocator = (PolicyEnforcementServiceLocator) serviceConfig.getInstance(); } if (m_pesLocator == null) { m_pesLocator = (PolicyEnforcementServiceLocator) serviceConfig.getProperties().get( "policyEnforcementServiceLocator"); } if (m_pesLocator == null) { // backwards compatibility SecurityConfigPolicyEnforcementServiceLocator securityConfigLocator = new SecurityConfigPolicyEnforcementServiceLocator(); securityConfigLocator.setServiceConfig(serviceConfig); m_pesLocator = securityConfigLocator; } httpClientFactory = (HTTPClientFactory) serviceConfig.getProperties().get(HttpRequestForward.HTTP_CLIENT_FACTORY); if (httpClientFactory == null) { httpClientFactory = new JDKHTTPClientFactory(); } }
public void doService(WebSecurityProcessingContext securityCtx, WebContext webCtx, WebSecurityProcessorChain processorChain) throws IOException { HttpServletRequest req = webCtx.getRequest(); HttpServletResponse resp = webCtx.getResponse(); WSSRequestUrlFactory requestUrlFactory = new WSSRequestUrlFactory(); requestUrlFactory.setTargetPathPatternMappingService(getPathMappingService()); EnforcementServiceRequest wssRequestUrl = requestUrlFactory.getInstance(req); String pesId = wssRequestUrl.getEnforcementPointId(); PolicyEnforcementServiceImpl pes = pesLocator.locate(pesId); if (pes == null) { String errorMessage = String.format( "No enforcement point configuration for id <%s>", pesId); resp.sendError(HttpServletResponse.SC_NOT_FOUND, errorMessage); return; } ForwardingSecuredServiceRequestBuilder requestBuilder = new ForwardingSecuredServiceRequestBuilder(wssRequestUrl); requestBuilder.setProtectedServiceEndpoint(new URL(pes.getEndpoint())); //this doesn't work, yet. It simply assumes, that there is a valid path to this endpoint ending with /public requestBuilder.setRedirectionAuthenticationUrl(wssRequestUrl.buildServiceUrl() + "/public"); SecuredServiceRequest secRequest = requestBuilder.build(req, resp); if (getHttpClientFactory() == null){ secRequest.addAttribute(new SimpleTransferAttribute(HttpRequestForward.HTTP_CLIENT_FACTORY, new JDKHTTPClientFactory())); } else { secRequest.addAttribute(new SimpleTransferAttribute(HttpRequestForward.HTTP_CLIENT_FACTORY, getHttpClientFactory())); } authorize(resp, pes, secRequest, securityCtx.getAuthenticationContext()); processorChain.performAccessControl(webCtx); }