Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered InteractiveAuthServlet"); try { String redirectUrl; SsoSession ssoSession = SsoUtils.getSsoSession(request); ssoContext.removeSsoSessionById(ssoSession); if (StringUtils.isEmpty(ssoSession.getClientId())) { redirectUrl = ssoContext.getEngineUrl(); } else { Credentials userCredentials = getUserCredentials(request); try { if (SsoUtils.isUserAuthenticated(request)) { log.debug("User is authenticated redirecting to {}", SsoConstants.INTERACTIVE_REDIRECT_TO_MODULE_URI); redirectUrl = request.getContextPath() + SsoConstants.INTERACTIVE_REDIRECT_TO_MODULE_URI; } else { redirectUrl = authenticateUser(request, response, userCredentials); } } catch (AuthenticationException ex) { if (userCredentials != null) { String profile = userCredentials.getProfile() == null ? "N/A" : userCredentials.getProfile(); log.error("Cannot authenticate user '{}@{}' connecting from '{}': {}", userCredentials.getUsername(), profile, ssoSession.getSourceAddr(), ex.getMessage()); log.debug("Exception", ex); SsoUtils.getSsoSession(request).setLoginMessage(ex.getMessage()); } log.debug("Redirecting to LoginPage"); ssoSession.setReauthenticate(false); ssoContext.registerSsoSessionById(SsoUtils.generateIdToken(), ssoSession); if (StringUtils.isNotEmpty(ssoContext.getSsoDefaultProfile()) && Arrays.stream(request.getCookies()).noneMatch(c -> c.getName().equals("profile"))) { Cookie cookie = new Cookie("profile", ssoContext.getSsoDefaultProfile()); cookie.setSecure("https".equals(request.getScheme())); response.addCookie(cookie); } redirectUrl = request.getContextPath() + SsoConstants.INTERACTIVE_LOGIN_FORM_URI; } } if (redirectUrl != null) { response.sendRedirect(redirectUrl); } } catch (Exception ex) { SsoUtils.redirectToErrorPage(request, response, ex); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered InteractiveAuthServlet"); try { String redirectUrl; SsoSession ssoSession = SsoUtils.getSsoSession(request); ssoContext.removeSsoSessionById(ssoSession); if (StringUtils.isEmpty(ssoSession.getClientId())) { redirectUrl = ssoContext.getEngineUrl(); } else { Credentials userCredentials = getUserCredentials(request); try { if (SsoUtils.isUserAuthenticated(request)) { log.debug("User is authenticated redirecting to {}", SsoConstants.INTERACTIVE_REDIRECT_TO_MODULE_URI); redirectUrl = request.getContextPath() + SsoConstants.INTERACTIVE_REDIRECT_TO_MODULE_URI; } else { redirectUrl = authenticateUser(request, response, userCredentials); } } catch (AuthenticationException ex) { if (userCredentials != null) { String profile = userCredentials.getProfile() == null ? "N/A" : userCredentials.getProfile(); log.error("Cannot authenticate user '{}@{}' connecting from '{}': {}", userCredentials.getUsername(), profile, ssoSession.getSourceAddr(), ex.getMessage()); log.debug("Exception", ex); SsoUtils.getSsoSession(request).setLoginMessage(ex.getMessage()); } log.debug("Redirecting to LoginPage"); ssoSession.setReauthenticate(false); ssoContext.registerSsoSessionById(SsoUtils.generateIdToken(), ssoSession); if (StringUtils.isNotEmpty(ssoContext.getSsoDefaultProfile()) && Arrays.stream(request.getCookies()).noneMatch(c -> c.getName().equals("profile"))) { Cookie cookie = new Cookie("profile", ssoContext.getSsoDefaultProfile()); cookie.setSecure("https".equalsIgnoreCase(request.getScheme())); response.addCookie(cookie); } redirectUrl = request.getContextPath() + SsoConstants.INTERACTIVE_LOGIN_FORM_URI; } } if (redirectUrl != null) { response.sendRedirect(redirectUrl); } } catch (Exception ex) { SsoUtils.redirectToErrorPage(request, response, ex); } }