}
String serverURL = CarbonUIUtil.getServerURL(session.getServletContext(), session);
ConfigurationContext configContext = (ConfigurationContext) session.getServletContext()
.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
SAMLSSOServiceClient ssoServiceClient = new SAMLSSOServiceClient(serverURL, configContext);
try {
if (username == null && password == null) { // First request without credentials. Should redirect to login page
String samlRequest = request.getParameter("SAMLRequest");
String authMode = SAMLSSOProviderConstants.AuthnModes.USERNAME_PASSWORD;