public void authorize(final HttpServletResponse resp, PolicyEnforcementServiceImpl pes, SecuredServiceRequest secRequest, AuthenticationContext authCtx) { Transferable response; try { response = pes.doService(secRequest, authCtx); } catch (ServiceException e) { new TransferableServletWriter(e.getAsTransferable()).write(resp); return; } new TransferableServletWriter(response).write(resp); }
public void authorize(final HttpServletResponse resp, PolicyEnforcementServiceImpl pes, SecuredServiceRequest secRequest) { AuthenticationContext authctx = AuthenticationContextUtil.getCurrentAuthenticationContext(); Transferable response; try { response = pes.doService(secRequest, authctx); } catch (ServiceException e) { new TransferableServletWriter(e.getAsTransferable()).write(resp); return; } new TransferableServletWriter(response).write(resp); }
throw new ServiceException("Could not create capabilities document", ServiceException.SERVICE_ERROR, e); new TransferableServletWriter(transferableCaps).write(m_servletResponse); throw new AuthenticationTerminationException("Returning WSS GetCapabilities response."); } else if ("GetSession".equalsIgnoreCase(m_wssParamOperation)) { AuthenticationContext authenticationContext = login(credential); SessionInfo sessionInfo = m_sessionService.createSession(authenticationContext); new TransferableServletWriter(sessionInfo.getAsTransferable()).write(m_servletResponse); throw new AuthenticationTerminationException("Returning WSS GetSession response."); } else if ("CloseSession".equalsIgnoreCase(m_wssParamOperation)) { "success", "UTF-8")).write(m_servletResponse); throw new AuthenticationTerminationException("Returning WSS CloseSession response."); } else if ("DoService".equalsIgnoreCase(m_wssParamOperation)) {
public AuthenticationContext authenticate(ServletRequestResponseContext requestCtx, AuthenticationService authService) throws AuthenticationException { m_servletRequest = requestCtx.getRequest(); m_servletResponse = requestCtx.getResponse(); m_wssRequestUrl = getWssRequestUrlFactory().getInstance(m_servletRequest); m_authenticationService = authService; try { assertHttpPostOrGetOrEmpty(); initWSSProtocolParameters(); extractWssParamOperation(); extractWssParamService(); extractWssParamVersion(); if (wssParamOperationNotNull()) { LOG.debug("Missing REQUEST parameter"); return m_authenticationService.createAuthenticationContext(); } AuthenticationContext authCtx = handleWSSOperation(); //We only get here if request was "DoService", cause otherwise handleWSSOperation threw an Exception. WSSHttpServletRequest wssRequest = wrapServletRequest(m_servletRequest); requestCtx.setRequest(wssRequest); return authCtx; } catch (ServiceException e) { new TransferableServletWriter(e.getAsTransferable()).write(m_servletResponse); // TODO Check what we really must return. return null; } }