private void redirectToLogin(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.sendRedirect(loginUriProvider.getLoginUri(URI.create(req.getRequestURL().toString())).toASCIIString()); }
private String getLoginRedirectUrl(HttpServletRequest request) { final StringBuffer callback = request.getRequestURL(); if (!StringUtils.isBlank(request.getQueryString())) { callback.append("?").append(request.getQueryString()); } return loginProvider.getLoginUriForRole(URI.create(callback.toString()), UserRole.ADMIN).toASCIIString(); } }
public void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { response.sendRedirect(loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
/** * Handles access denied as decided by this filter. * By default, we simply redirect to a login page. Override this method if you want it to do something else. * * @param request request * @param response response * @throws java.io.IOException IOException */ protected void handleAccessDenied(HttpServletRequest request, HttpServletResponse response) throws IOException { // By default, we redirect to login page so if user actually has the privilege, he will eventually get // redirected to the right page after the login. response.sendRedirect(loginUriProvider.getLoginUriForRole(getOriginalUrl(request), getForRole(), EnumSet.of(PageCapability.IFRAME)).toASCIIString()); }
protected void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { final URI uri = getUri(request); String uriString = uri.toASCIIString(); request.getSession().setAttribute(JIRA_SERAPH_SECURITY_ORIGINAL_URL, uriString); request.getSession().setAttribute(CONF_SERAPH_SECURITY_ORIGINAL_URL, uriString); response.sendRedirect(loginUriProvider.getLoginUri(uri).toASCIIString()); }
/** * Handles access denied as decided by this filter. * By default, we simply redirect to a login page. Override this method if you want it to do something else. * * @param request request * @param response response * @throws java.io.IOException IOException */ protected void handleAccessDenied(HttpServletRequest request, HttpServletResponse response) throws IOException { // By default, we redirect to login page so if user actually has the privilege, he will eventually get // redirected to the right page after the login. response.sendRedirect(loginUriProvider.getLoginUriForRole(getOriginalUrl(request), getForRole(), EnumSet.of(PageCapability.IFRAME)).toASCIIString()); }
private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { response.sendRedirect(loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { response.sendRedirect(loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { response.sendRedirect(loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { response.sendRedirect(loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
protected void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { final URI uri = getUri(request); addSessionAttributes(request, uri.toASCIIString()); response.sendRedirect(loginUriProvider.getLoginUri(uri).toASCIIString()); }
public void redirect(final HttpServletRequest request, final HttpServletResponse response) throws IOException { final URI requestUri = HttpServletRequests.getUri(request); addSessionAttributes(request, requestUri.toASCIIString()); response.sendRedirect(loginUriProvider.getLoginUri(requestUri).toASCIIString()); }
public void execute(final CtkTestResults results) throws URISyntaxException, UnsupportedEncodingException { results.assertTrue("LoginUriProvider should be injectable", provider != null); String destUri = "http://server/dest.html?param=value"; URI loginUri = provider.getLoginUri(new URI(destUri)); results.assertTrue("Login URI should contain destination: " + loginUri.toString(), loginUri.toString().contains(URLEncoder.encode(destUri, "UTF-8"))); } }
public void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { final URI uri = getUri(request); addSessionAttributes(request, uri.toString()); response.sendRedirect(loginUriProvider.getLoginUri(uri).toString()); }
/** * Copied from com.atlassian.upm.PluginManagerHandler. */ public void redirectToLogin(final HttpServletRequest request, final HttpServletResponse response) throws IOException { final URI uri = getUri(request); addSessionAttributes(request, uri.toASCIIString()); response.sendRedirect(loginUriProvider.getLoginUri(uri).toASCIIString()); }
private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { final URI uri = getUri(request); addSessionAttributes(request, uri.toASCIIString()); response.sendRedirect(loginUriProvider.getLoginUri(uri).toASCIIString()); }
@Test public void testGetLoginUriMustContainDestinationUriAsParameterValue() throws URISyntaxException, UnsupportedEncodingException { String destUri = "http://server/dest.html?param=value"; URI loginUri = provider.getLoginUri(new URI(destUri)); assertThatDestinationUriIsEncodedAsLoginUriQueryParameterValue(destUri, loginUri); }
@Test public void testGetLoginUriMustContainDestinationUriWithAmpersandAsParameterValue() throws URISyntaxException, UnsupportedEncodingException { String destUri = "http://server/dest.html?param=value&p2=val2"; URI loginUri = provider.getLoginUri(new URI(destUri)); assertThatDestinationUriIsEncodedAsLoginUriQueryParameterValue(destUri, loginUri); } }
/** * Copied from our <a href= "http://confluence.atlassian.com/display/DEVNET/Plugin+tutorial+-+Writing+an+Admin+Configuration+Screen" * >cross-product admin example code</a>. */ private void redirectToLogin(HttpServletRequest request, HttpServletResponse response) throws IOException { final URI uri = getUri(request); addSessionAttributes(request, uri.toASCIIString()); response.sendRedirect(this.loginUriProvider.getLoginUri(getUri(request)).toASCIIString()); }
@Override protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (!isAdmin(request)) { URI returnUri = URI.create(request.getServletPath() + (request.getQueryString() != null ? "?" + request.getQueryString() : "")); response.sendRedirect(loginUriProvider.getLoginUri(returnUri).toString()); return; } try { webSudoManager.willExecuteWebSudoRequest(request); doRestrictedGet(request, response); } catch (WebSudoSessionException wes) { webSudoManager.enforceWebSudoProtection(request, response); } }