public HttpIdentityResponse build() { return new HttpIdentityResponse(this); }
private void processHttpResponse(HttpIdentityResponse httpIdentityResponse, HttpServletRequest request, HttpServletResponse response) { for(Map.Entry<String,String> entry: httpIdentityResponse.getHeaders().entrySet()) { response.addHeader(entry.getKey(), entry.getValue()); } for(Map.Entry<String,Cookie> entry: httpIdentityResponse.getCookies().entrySet()) { response.addCookie(entry.getValue()); } if(StringUtils.isNotBlank(httpIdentityResponse.getContentType())) { response.setContentType(httpIdentityResponse.getContentType()); } if (httpIdentityResponse.getStatusCode() == HttpServletResponse.SC_MOVED_TEMPORARILY) { try { sendRedirect(response, httpIdentityResponse); } catch (IOException ex) { throw FrameworkRuntimeException.error("Error occurred while redirecting response", ex); } } else { response.setStatus(httpIdentityResponse.getStatusCode()); try { PrintWriter out = response.getWriter(); if(StringUtils.isNotBlank(httpIdentityResponse.getBody())) { out.print(httpIdentityResponse.getBody()); } } catch (IOException e) { throw FrameworkRuntimeException.error("Error occurred while getting Response writer object", e); } } }
/** * Sends a 302 redirect response to client. * * @param response {@link HttpServletResponse} * @param httpIdentityResponse {@link HttpIdentityResponse} */ private void sendRedirect(HttpServletResponse response, HttpIdentityResponse httpIdentityResponse) throws IOException { String redirectUrl; if(httpIdentityResponse.isFragmentUrl()) { redirectUrl = IdentityUtil.buildFragmentUrl(httpIdentityResponse.getRedirectURL(), httpIdentityResponse.getParameters()); } else { redirectUrl = IdentityUtil.buildQueryUrl(httpIdentityResponse.getRedirectURL(), httpIdentityResponse.getParameters()); } response.sendRedirect(redirectUrl); } }
private void sendRedirect(HttpServletResponse response, HttpIdentityResponse httpIdentityResponse) throws IOException { String queryParams = IdentityUtil.buildQueryString(httpIdentityResponse.getParameters()); response.sendRedirect(httpIdentityResponse.getRedirectURL() + queryParams); } }
for(Map.Entry<String,String> entry: httpIdentityResponse.getHeaders().entrySet()) { response.addHeader(entry.getKey(), entry.getValue()); for(Map.Entry<String,Cookie> entry: httpIdentityResponse.getCookies().entrySet()) { response.addCookie(entry.getValue()); if(StringUtils.isNotBlank(httpIdentityResponse.getContentType())) { response.setContentType(httpIdentityResponse.getContentType()); if (httpIdentityResponse.getStatusCode() == HttpServletResponse.SC_MOVED_TEMPORARILY) { try { sendRedirect(response, httpIdentityResponse); response.setStatus(httpIdentityResponse.getStatusCode()); try { PrintWriter out = response.getWriter(); if(StringUtils.isNotBlank(httpIdentityResponse.getBody())) { out.print(httpIdentityResponse.getBody());
/** * Sends a 302 redirect response to client. * * @param response {@link HttpServletResponse} * @param httpIdentityResponse {@link HttpIdentityResponse} */ private void sendRedirect(HttpServletResponse response, HttpIdentityResponse httpIdentityResponse) throws IOException { String redirectUrl; if(httpIdentityResponse.isFragmentUrl()) { redirectUrl = IdentityUtil.buildFragmentUrl(httpIdentityResponse.getRedirectURL(), httpIdentityResponse.getParameters()); } else { redirectUrl = IdentityUtil.buildQueryUrl(httpIdentityResponse.getRedirectURL(), httpIdentityResponse.getParameters()); } response.sendRedirect(redirectUrl); } }
for(Map.Entry<String,String> entry: httpIdentityResponse.getHeaders().entrySet()) { response.addHeader(entry.getKey(), entry.getValue()); for(Map.Entry<String,Cookie> entry: httpIdentityResponse.getCookies().entrySet()) { response.addCookie(entry.getValue()); if(StringUtils.isNotBlank(httpIdentityResponse.getContentType())) { response.setContentType(httpIdentityResponse.getContentType()); if (httpIdentityResponse.getStatusCode() == HttpServletResponse.SC_MOVED_TEMPORARILY) { try { sendRedirect(response, httpIdentityResponse); response.setStatus(httpIdentityResponse.getStatusCode()); try { PrintWriter out = response.getWriter(); if(StringUtils.isNotBlank(httpIdentityResponse.getBody())) { out.print(httpIdentityResponse.getBody());
public HttpIdentityResponse build() { return new HttpIdentityResponse(this); }
public HttpIdentityResponse build() { return new HttpIdentityResponse(this); }