private Transferable createDefaultError() { return (new ServiceException(ServiceException.ERROR_MESSAGE, ServiceException.SERVICE_ERROR)).getAsTransferable(); }
private Transferable forwardRequest(FacadeRequest facadeRequest) throws FacadeException, UnknownFacadeException, ServiceException { Facade facade = findFacade(facadeRequest); try { return facade.request(facadeRequest); } catch (ServiceException e) { if (isAuthenticationFailed(e)) { return prepareAndTryAgain(facadeRequest, facade); } return e.getAsTransferable(); } }
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); }
} else { pInterceptorRequest.setAttribute(REQUEST_ATTRIBUTE_NOINFO, new ServiceException( getInsufficientRightsMessage(), ServiceException.AUTHORIZATION_FAILED).getAsTransferable());
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; } }