Encode authenticator names in the redirect URL
@@ -716,7 +716,7 @@ public class DefaultStepHandler implements StepHandler {
retryParam = retryParam + "&errorCode=" + errorCode + "&failedUsername=" + URLEncoder.encode
(request.getParameter("username"), "UTF-8") + "&remainingAttempts=" + remainingAttempts;
return response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams()))
- + "&authenticators=" + authenticatorNames + ":" + FrameworkConstants.LOCAL + retryParam;
+ + "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
} else if (UserCoreConstants.ErrorCode.USER_IS_LOCKED.equals(errorCode)) {
String redirectURL;
if (remainingAttempts == 0) {
@@ -760,7 +760,7 @@ public class DefaultStepHandler implements StepHandler {
retryParam = retryParam + "&errorCode=" + errorCode + "&failedUsername=" + URLEncoder.encode
(username, "UTF-8");
return response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams()))
- + "&authenticators=" + authenticatorNames + ":" + FrameworkConstants.LOCAL + retryParam;
+ + "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
} else if (IdentityCoreConstants.ADMIN_FORCED_USER_PASSWORD_RESET_VIA_OTP_ERROR_CODE.equals(errorCode)) {
String username = request.getParameter("username");
return response.encodeRedirectURL(
@@ -770,11 +770,11 @@ public class DefaultStepHandler implements StepHandler {
retryParam = retryParam + "&errorCode=" + errorCode + "&failedUsername=" + URLEncoder.encode
(request.getParameter("username"), "UTF-8");
return response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams()))
- + "&authenticators=" + authenticatorNames + ":" + FrameworkConstants.LOCAL + retryParam;
+ + "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
}
} else {
return response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams())) +
- "&authenticators=" + authenticatorNames + ":" + FrameworkConstants.LOCAL + retryParam;
+ "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
}
} else {
String errorCode = errorContext != null ? errorContext.getErrorCode() : null;
@@ -782,7 +782,7 @@ public class DefaultStepHandler implements StepHandler {
String redirectURL;
redirectURL = response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams()
)) + "&failedUsername=" + URLEncoder.encode(request.getParameter("username"), "UTF-8") +
- "&authenticators=" + authenticatorNames + ":" + FrameworkConstants.LOCAL + retryParam;
+ "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
return redirectURL;
} else if (IdentityCoreConstants.ADMIN_FORCED_USER_PASSWORD_RESET_VIA_OTP_ERROR_CODE.equals(errorCode)) {
@@ -792,8 +792,7 @@ public class DefaultStepHandler implements StepHandler {
+ "&username=" + URLEncoder.encode(username, "UTF-8") + "&confirmation=" + otp;
} else {
return response.encodeRedirectURL(loginPage + ("?" + context.getContextIdIncludedQueryParams())) +
- "&authenticators=" + URLEncoder.encode(authenticatorNames + ":" + FrameworkConstants.LOCAL,
- "UTF-8") + retryParam;
+ "&authenticators=" + URLEncoder.encode(authenticatorNames, "UTF-8") + retryParam;
}
}
}
