|
@@ -33,12 +33,12 @@ import com.novell.ldapchai.provider.ChaiProvider;
|
|
import password.pwm.AppProperty;
|
|
import password.pwm.AppProperty;
|
|
import password.pwm.PwmApplication;
|
|
import password.pwm.PwmApplication;
|
|
import password.pwm.PwmConstants;
|
|
import password.pwm.PwmConstants;
|
|
-import password.pwm.RecoveryVerificationMethod;
|
|
|
|
|
|
+import password.pwm.VerificationMethodSystem;
|
|
import password.pwm.bean.*;
|
|
import password.pwm.bean.*;
|
|
import password.pwm.config.*;
|
|
import password.pwm.config.*;
|
|
import password.pwm.config.option.MessageSendMethod;
|
|
import password.pwm.config.option.MessageSendMethod;
|
|
import password.pwm.config.option.RecoveryAction;
|
|
import password.pwm.config.option.RecoveryAction;
|
|
-import password.pwm.config.option.RecoveryVerificationMethods;
|
|
|
|
|
|
+import password.pwm.config.option.IdentityVerificationMethod;
|
|
import password.pwm.config.profile.ForgottenPasswordProfile;
|
|
import password.pwm.config.profile.ForgottenPasswordProfile;
|
|
import password.pwm.config.profile.ProfileType;
|
|
import password.pwm.config.profile.ProfileType;
|
|
import password.pwm.config.profile.ProfileUtility;
|
|
import password.pwm.config.profile.ProfileUtility;
|
|
@@ -295,13 +295,13 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
{
|
|
{
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
final String requestedChoiceStr = pwmRequest.readParameterAsString("choice");
|
|
final String requestedChoiceStr = pwmRequest.readParameterAsString("choice");
|
|
- final LinkedHashSet<RecoveryVerificationMethods> remainingAvailableOptionalMethods = new LinkedHashSet<>(figureRemainingAvailableOptionalAuthMethods(forgottenPasswordBean));
|
|
|
|
|
|
+ final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(figureRemainingAvailableOptionalAuthMethods(forgottenPasswordBean));
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.AvailableAuthMethods, remainingAvailableOptionalMethods);
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.AvailableAuthMethods, remainingAvailableOptionalMethods);
|
|
|
|
|
|
- RecoveryVerificationMethods requestedChoice = null;
|
|
|
|
|
|
+ IdentityVerificationMethod requestedChoice = null;
|
|
if (requestedChoiceStr != null && !requestedChoiceStr.isEmpty()) {
|
|
if (requestedChoiceStr != null && !requestedChoiceStr.isEmpty()) {
|
|
try {
|
|
try {
|
|
- requestedChoice = RecoveryVerificationMethods.valueOf(requestedChoiceStr);
|
|
|
|
|
|
+ requestedChoice = IdentityVerificationMethod.valueOf(requestedChoiceStr);
|
|
} catch (IllegalArgumentException e) {
|
|
} catch (IllegalArgumentException e) {
|
|
final String errorMsg = "unknown verification method requested";
|
|
final String errorMsg = "unknown verification method requested";
|
|
final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_MISSING_PARAMETER,errorMsg);
|
|
final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_MISSING_PARAMETER,errorMsg);
|
|
@@ -428,7 +428,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
forgottenPasswordBean
|
|
forgottenPasswordBean
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.TOKEN);
|
|
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.TOKEN);
|
|
StatisticsManager.incrementStat(pwmRequest.getPwmApplication(), Statistic.RECOVERY_TOKENS_PASSED);
|
|
StatisticsManager.incrementStat(pwmRequest.getPwmApplication(), Statistic.RECOVERY_TOKENS_PASSED);
|
|
}
|
|
}
|
|
} catch (PwmOperationalException e) {
|
|
} catch (PwmOperationalException e) {
|
|
@@ -436,7 +436,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
errorInformation = new ErrorInformation(PwmError.ERROR_TOKEN_INCORRECT,errorMsg);
|
|
errorInformation = new ErrorInformation(PwmError.ERROR_TOKEN_INCORRECT,errorMsg);
|
|
}
|
|
}
|
|
|
|
|
|
- if (!forgottenPasswordBean.getProgress().getSatisfiedMethods().contains(RecoveryVerificationMethods.TOKEN)) {
|
|
|
|
|
|
+ if (!forgottenPasswordBean.getProgress().getSatisfiedMethods().contains(IdentityVerificationMethod.TOKEN)) {
|
|
if (errorInformation == null) {
|
|
if (errorInformation == null) {
|
|
errorInformation = new ErrorInformation(PwmError.ERROR_TOKEN_INCORRECT);
|
|
errorInformation = new ErrorInformation(PwmError.ERROR_TOKEN_INCORRECT);
|
|
}
|
|
}
|
|
@@ -449,7 +449,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
{
|
|
{
|
|
final String PREFIX = "naaf-";
|
|
final String PREFIX = "naaf-";
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
- final RecoveryVerificationMethod naafMethod = forgottenPasswordBean.getProgress().getNaafRecoveryMethod();
|
|
|
|
|
|
+ final VerificationMethodSystem naafMethod = forgottenPasswordBean.getProgress().getNaafRecoveryMethod();
|
|
|
|
|
|
final Map<String,String> naafResponses = new LinkedHashMap<>();
|
|
final Map<String,String> naafResponses = new LinkedHashMap<>();
|
|
{
|
|
{
|
|
@@ -465,11 +465,11 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
final ErrorInformation errorInformation = naafMethod.respondToPrompts(naafResponses);
|
|
final ErrorInformation errorInformation = naafMethod.respondToPrompts(naafResponses);
|
|
|
|
|
|
- if (naafMethod.getVerificationState() == RecoveryVerificationMethod.VerificationState.COMPLETE) {
|
|
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.NAAF);
|
|
|
|
|
|
+ if (naafMethod.getVerificationState() == VerificationMethodSystem.VerificationState.COMPLETE) {
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.NAAF);
|
|
}
|
|
}
|
|
|
|
|
|
- if (naafMethod.getVerificationState() == RecoveryVerificationMethod.VerificationState.FAILED) {
|
|
|
|
|
|
+ if (naafMethod.getVerificationState() == VerificationMethodSystem.VerificationState.FAILED) {
|
|
forgottenPasswordBean.getProgress().setNaafRecoveryMethod(null);
|
|
forgottenPasswordBean.getProgress().setNaafRecoveryMethod(null);
|
|
pwmRequest.respondWithError(errorInformation,true);
|
|
pwmRequest.respondWithError(errorInformation,true);
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, errorInformation);
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, errorInformation);
|
|
@@ -488,7 +488,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
{
|
|
{
|
|
final String PREFIX = "remote-";
|
|
final String PREFIX = "remote-";
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean(pwmRequest);
|
|
- final RecoveryVerificationMethod remoteRecoveryMethod = forgottenPasswordBean.getProgress().getRemoteRecoveryMethod();
|
|
|
|
|
|
+ final VerificationMethodSystem remoteRecoveryMethod = forgottenPasswordBean.getProgress().getRemoteRecoveryMethod();
|
|
|
|
|
|
final Map<String,String> remoteResponses = new LinkedHashMap<>();
|
|
final Map<String,String> remoteResponses = new LinkedHashMap<>();
|
|
{
|
|
{
|
|
@@ -504,11 +504,11 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
final ErrorInformation errorInformation = remoteRecoveryMethod.respondToPrompts(remoteResponses);
|
|
final ErrorInformation errorInformation = remoteRecoveryMethod.respondToPrompts(remoteResponses);
|
|
|
|
|
|
- if (remoteRecoveryMethod.getVerificationState() == RecoveryVerificationMethod.VerificationState.COMPLETE) {
|
|
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.REMOTE_RESPONSES);
|
|
|
|
|
|
+ if (remoteRecoveryMethod.getVerificationState() == VerificationMethodSystem.VerificationState.COMPLETE) {
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.REMOTE_RESPONSES);
|
|
}
|
|
}
|
|
|
|
|
|
- if (remoteRecoveryMethod.getVerificationState() == RecoveryVerificationMethod.VerificationState.FAILED) {
|
|
|
|
|
|
+ if (remoteRecoveryMethod.getVerificationState() == VerificationMethodSystem.VerificationState.FAILED) {
|
|
forgottenPasswordBean.getProgress().setNaafRecoveryMethod(null);
|
|
forgottenPasswordBean.getProgress().setNaafRecoveryMethod(null);
|
|
pwmRequest.respondWithError(errorInformation,true);
|
|
pwmRequest.respondWithError(errorInformation,true);
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, errorInformation);
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, errorInformation);
|
|
@@ -546,7 +546,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
if (otpPassed) {
|
|
if (otpPassed) {
|
|
StatisticsManager.incrementStat(pwmRequest, Statistic.RECOVERY_OTP_PASSED);
|
|
StatisticsManager.incrementStat(pwmRequest, Statistic.RECOVERY_OTP_PASSED);
|
|
LOGGER.debug(pwmRequest, "one time password validation has been passed");
|
|
LOGGER.debug(pwmRequest, "one time password validation has been passed");
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.OTP);
|
|
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.OTP);
|
|
} else {
|
|
} else {
|
|
StatisticsManager.incrementStat(pwmRequest, Statistic.RECOVERY_OTP_FAILED);
|
|
StatisticsManager.incrementStat(pwmRequest, Statistic.RECOVERY_OTP_FAILED);
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, new ErrorInformation(PwmError.ERROR_INCORRECT_OTP_TOKEN));
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, new ErrorInformation(PwmError.ERROR_INCORRECT_OTP_TOKEN));
|
|
@@ -610,7 +610,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.CHALLENGE_RESPONSES);
|
|
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.CHALLENGE_RESPONSES);
|
|
}
|
|
}
|
|
|
|
|
|
private void processCheckAttributes(final PwmRequest pwmRequest)
|
|
private void processCheckAttributes(final PwmRequest pwmRequest)
|
|
@@ -651,7 +651,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- forgottenPasswordBean.getProgress().getSatisfiedMethods().add(RecoveryVerificationMethods.ATTRIBUTES);
|
|
|
|
|
|
+ forgottenPasswordBean.getProgress().getSatisfiedMethods().add(IdentityVerificationMethod.ATTRIBUTES);
|
|
} catch (PwmDataValidationException e) {
|
|
} catch (PwmDataValidationException e) {
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, new ErrorInformation(PwmError.ERROR_INCORRECT_RESPONSE,e.getErrorInformation().toDebugStr()));
|
|
handleUserVerificationBadAttempt(pwmRequest, forgottenPasswordBean, new ErrorInformation(PwmError.ERROR_INCORRECT_RESPONSE,e.getErrorInformation().toDebugStr()));
|
|
}
|
|
}
|
|
@@ -691,17 +691,17 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
|
|
|
|
// check for previous authentication
|
|
// check for previous authentication
|
|
- if (recoveryFlags.getRequiredAuthMethods().contains(RecoveryVerificationMethods.PREVIOUS_AUTH) || recoveryFlags.getOptionalAuthMethods().contains(RecoveryVerificationMethods.PREVIOUS_AUTH)) {
|
|
|
|
- if (!progress.getSatisfiedMethods().contains(RecoveryVerificationMethods.PREVIOUS_AUTH)) {
|
|
|
|
|
|
+ if (recoveryFlags.getRequiredAuthMethods().contains(IdentityVerificationMethod.PREVIOUS_AUTH) || recoveryFlags.getOptionalAuthMethods().contains(IdentityVerificationMethod.PREVIOUS_AUTH)) {
|
|
|
|
+ if (!progress.getSatisfiedMethods().contains(IdentityVerificationMethod.PREVIOUS_AUTH)) {
|
|
if (checkAuthRecord(pwmRequest, forgottenPasswordBean.getUserInfo().getUserGuid())) {
|
|
if (checkAuthRecord(pwmRequest, forgottenPasswordBean.getUserInfo().getUserGuid())) {
|
|
- LOGGER.debug(pwmRequest, "marking " + RecoveryVerificationMethods.PREVIOUS_AUTH + " method as satisfied");
|
|
|
|
- progress.getSatisfiedMethods().add(RecoveryVerificationMethods.PREVIOUS_AUTH);
|
|
|
|
|
|
+ LOGGER.debug(pwmRequest, "marking " + IdentityVerificationMethod.PREVIOUS_AUTH + " method as satisfied");
|
|
|
|
+ progress.getSatisfiedMethods().add(IdentityVerificationMethod.PREVIOUS_AUTH);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// dispatch required auth methods.
|
|
// dispatch required auth methods.
|
|
- for (final RecoveryVerificationMethods method : recoveryFlags.getRequiredAuthMethods()) {
|
|
|
|
|
|
+ for (final IdentityVerificationMethod method : recoveryFlags.getRequiredAuthMethods()) {
|
|
if (!progress.getSatisfiedMethods().contains(method)) {
|
|
if (!progress.getSatisfiedMethods().contains(method)) {
|
|
forwardUserBasedOnRecoveryMethod(pwmRequest, method);
|
|
forwardUserBasedOnRecoveryMethod(pwmRequest, method);
|
|
return;
|
|
return;
|
|
@@ -721,9 +721,9 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
// check if more optional methods required
|
|
// check if more optional methods required
|
|
if (recoveryFlags.getMinimumOptionalAuthMethods() > 0) {
|
|
if (recoveryFlags.getMinimumOptionalAuthMethods() > 0) {
|
|
- final Set<RecoveryVerificationMethods> satisfiedOptionalMethods = figureSatisfiedOptionalAuthMethods(recoveryFlags,progress);
|
|
|
|
|
|
+ final Set<IdentityVerificationMethod> satisfiedOptionalMethods = figureSatisfiedOptionalAuthMethods(recoveryFlags,progress);
|
|
if (satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods()) {
|
|
if (satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods()) {
|
|
- final Set<RecoveryVerificationMethods> remainingAvailableOptionalMethods = figureRemainingAvailableOptionalAuthMethods(forgottenPasswordBean);
|
|
|
|
|
|
+ final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = figureRemainingAvailableOptionalAuthMethods(forgottenPasswordBean);
|
|
if (remainingAvailableOptionalMethods.isEmpty()) {
|
|
if (remainingAvailableOptionalMethods.isEmpty()) {
|
|
final String errorMsg = "additional optional verification methods are needed, however all available optional verification methods have been satisified by user";
|
|
final String errorMsg = "additional optional verification methods are needed, however all available optional verification methods have been satisified by user";
|
|
final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_INVALID_CONFIG,errorMsg);
|
|
final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_INVALID_CONFIG,errorMsg);
|
|
@@ -731,7 +731,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
throw new PwmUnrecoverableException(errorInformation);
|
|
throw new PwmUnrecoverableException(errorInformation);
|
|
} else {
|
|
} else {
|
|
if (remainingAvailableOptionalMethods.size() == 1) {
|
|
if (remainingAvailableOptionalMethods.size() == 1) {
|
|
- final RecoveryVerificationMethods remainingMethod = remainingAvailableOptionalMethods.iterator().next();
|
|
|
|
|
|
+ final IdentityVerificationMethod remainingMethod = remainingAvailableOptionalMethods.iterator().next();
|
|
LOGGER.debug(pwmRequest, "only 1 remaining available optional verification method, will redirect to " + remainingMethod.toString());
|
|
LOGGER.debug(pwmRequest, "only 1 remaining available optional verification method, will redirect to " + remainingMethod.toString());
|
|
forwardUserBasedOnRecoveryMethod(pwmRequest, remainingMethod);
|
|
forwardUserBasedOnRecoveryMethod(pwmRequest, remainingMethod);
|
|
progress.setInProgressVerificationMethod(remainingMethod);
|
|
progress.setInProgressVerificationMethod(remainingMethod);
|
|
@@ -1134,7 +1134,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
private static void verifyRequirementsForAuthMethod(
|
|
private static void verifyRequirementsForAuthMethod(
|
|
final ForgottenPasswordBean forgottenPasswordBean,
|
|
final ForgottenPasswordBean forgottenPasswordBean,
|
|
- final RecoveryVerificationMethods recoveryVerificationMethods) throws PwmUnrecoverableException
|
|
|
|
|
|
+ final IdentityVerificationMethod recoveryVerificationMethods) throws PwmUnrecoverableException
|
|
{
|
|
{
|
|
switch (recoveryVerificationMethods) {
|
|
switch (recoveryVerificationMethods) {
|
|
case TOKEN: {
|
|
case TOKEN: {
|
|
@@ -1228,8 +1228,8 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
final ResponseSet responseSet;
|
|
final ResponseSet responseSet;
|
|
final ChallengeSet challengeSet;
|
|
final ChallengeSet challengeSet;
|
|
- if (recoveryFlags.getRequiredAuthMethods().contains(RecoveryVerificationMethods.CHALLENGE_RESPONSES)
|
|
|
|
- || recoveryFlags.getOptionalAuthMethods().contains(RecoveryVerificationMethods.CHALLENGE_RESPONSES)) {
|
|
|
|
|
|
+ if (recoveryFlags.getRequiredAuthMethods().contains(IdentityVerificationMethod.CHALLENGE_RESPONSES)
|
|
|
|
+ || recoveryFlags.getOptionalAuthMethods().contains(IdentityVerificationMethod.CHALLENGE_RESPONSES)) {
|
|
try {
|
|
try {
|
|
final ChaiUser theUser = pwmApplication.getProxiedChaiUser(userInfoBean.getUserIdentity());
|
|
final ChaiUser theUser = pwmApplication.getProxiedChaiUser(userInfoBean.getUserIdentity());
|
|
responseSet = pwmApplication.getCrService().readUserResponseSet(
|
|
responseSet = pwmApplication.getCrService().readUserResponseSet(
|
|
@@ -1283,7 +1283,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
forgottenPasswordBean.setRecoveryFlags(recoveryFlags);
|
|
forgottenPasswordBean.setRecoveryFlags(recoveryFlags);
|
|
forgottenPasswordBean.setProgress(new ForgottenPasswordBean.Progress());
|
|
forgottenPasswordBean.setProgress(new ForgottenPasswordBean.Progress());
|
|
|
|
|
|
- for (final RecoveryVerificationMethods recoveryVerificationMethods : recoveryFlags.getRequiredAuthMethods()) {
|
|
|
|
|
|
+ for (final IdentityVerificationMethod recoveryVerificationMethods : recoveryFlags.getRequiredAuthMethods()) {
|
|
verifyRequirementsForAuthMethod(forgottenPasswordBean, recoveryVerificationMethods);
|
|
verifyRequirementsForAuthMethod(forgottenPasswordBean, recoveryVerificationMethods);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1297,8 +1297,8 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
final MessageSendMethod tokenSendMethod = config.getForgottenPasswordProfiles().get(forgottenPasswordProfileID).readSettingAsEnum(PwmSetting.RECOVERY_TOKEN_SEND_METHOD, MessageSendMethod.class);
|
|
final MessageSendMethod tokenSendMethod = config.getForgottenPasswordProfiles().get(forgottenPasswordProfileID).readSettingAsEnum(PwmSetting.RECOVERY_TOKEN_SEND_METHOD, MessageSendMethod.class);
|
|
|
|
|
|
- final Set<RecoveryVerificationMethods> requiredRecoveryVerificationMethods = forgottenPasswordProfile.requiredRecoveryAuthenticationMethods();
|
|
|
|
- final Set<RecoveryVerificationMethods> optionalRecoveryVerificationMethods = forgottenPasswordProfile.optionalRecoveryAuthenticationMethods();
|
|
|
|
|
|
+ final Set<IdentityVerificationMethod> requiredRecoveryVerificationMethods = forgottenPasswordProfile.requiredRecoveryAuthenticationMethods();
|
|
|
|
+ final Set<IdentityVerificationMethod> optionalRecoveryVerificationMethods = forgottenPasswordProfile.optionalRecoveryAuthenticationMethods();
|
|
final int minimumOptionalRecoveryAuthMethods = forgottenPasswordProfile.getMinOptionalRequired();
|
|
final int minimumOptionalRecoveryAuthMethods = forgottenPasswordProfile.getMinOptionalRequired();
|
|
final boolean allowWhenLdapIntruderLocked = forgottenPasswordProfile.readSettingAsBoolean(PwmSetting.RECOVERY_ALLOW_WHEN_LOCKED);
|
|
final boolean allowWhenLdapIntruderLocked = forgottenPasswordProfile.readSettingAsBoolean(PwmSetting.RECOVERY_ALLOW_WHEN_LOCKED);
|
|
|
|
|
|
@@ -1404,27 +1404,27 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_TOKEN_MISSING_CONTACT));
|
|
throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_TOKEN_MISSING_CONTACT));
|
|
}
|
|
}
|
|
|
|
|
|
- private static Set<RecoveryVerificationMethods> figureSatisfiedOptionalAuthMethods(
|
|
|
|
|
|
+ private static Set<IdentityVerificationMethod> figureSatisfiedOptionalAuthMethods(
|
|
ForgottenPasswordBean.RecoveryFlags recoveryFlags,
|
|
ForgottenPasswordBean.RecoveryFlags recoveryFlags,
|
|
ForgottenPasswordBean.Progress progress)
|
|
ForgottenPasswordBean.Progress progress)
|
|
{
|
|
{
|
|
- final Set<RecoveryVerificationMethods> result = new HashSet<>();
|
|
|
|
|
|
+ final Set<IdentityVerificationMethod> result = new HashSet<>();
|
|
result.addAll(recoveryFlags.getOptionalAuthMethods());
|
|
result.addAll(recoveryFlags.getOptionalAuthMethods());
|
|
result.retainAll(progress.getSatisfiedMethods());
|
|
result.retainAll(progress.getSatisfiedMethods());
|
|
return Collections.unmodifiableSet(result);
|
|
return Collections.unmodifiableSet(result);
|
|
}
|
|
}
|
|
|
|
|
|
- private static Set<RecoveryVerificationMethods> figureRemainingAvailableOptionalAuthMethods(
|
|
|
|
|
|
+ private static Set<IdentityVerificationMethod> figureRemainingAvailableOptionalAuthMethods(
|
|
final ForgottenPasswordBean forgottenPasswordBean
|
|
final ForgottenPasswordBean forgottenPasswordBean
|
|
)
|
|
)
|
|
{
|
|
{
|
|
ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
|
|
ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
|
|
ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
|
|
ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
|
|
- final Set<RecoveryVerificationMethods> result = new HashSet<>();
|
|
|
|
|
|
+ final Set<IdentityVerificationMethod> result = new HashSet<>();
|
|
result.addAll(recoveryFlags.getOptionalAuthMethods());
|
|
result.addAll(recoveryFlags.getOptionalAuthMethods());
|
|
result.removeAll(progress.getSatisfiedMethods());
|
|
result.removeAll(progress.getSatisfiedMethods());
|
|
|
|
|
|
- for (final RecoveryVerificationMethods recoveryVerificationMethods : new HashSet<>(result)) {
|
|
|
|
|
|
+ for (final IdentityVerificationMethod recoveryVerificationMethods : new HashSet<>(result)) {
|
|
try {
|
|
try {
|
|
verifyRequirementsForAuthMethod(forgottenPasswordBean, recoveryVerificationMethods);
|
|
verifyRequirementsForAuthMethod(forgottenPasswordBean, recoveryVerificationMethods);
|
|
} catch (PwmUnrecoverableException e) {
|
|
} catch (PwmUnrecoverableException e) {
|
|
@@ -1443,7 +1443,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
private void forwardUserBasedOnRecoveryMethod(
|
|
private void forwardUserBasedOnRecoveryMethod(
|
|
final PwmRequest pwmRequest,
|
|
final PwmRequest pwmRequest,
|
|
- final RecoveryVerificationMethods method)
|
|
|
|
|
|
+ final IdentityVerificationMethod method)
|
|
throws ServletException, PwmUnrecoverableException, IOException
|
|
throws ServletException, PwmUnrecoverableException, IOException
|
|
{
|
|
{
|
|
LOGGER.debug(pwmRequest,"attempting to forward request to handle verification method " + method.toString());
|
|
LOGGER.debug(pwmRequest,"attempting to forward request to handle verification method " + method.toString());
|
|
@@ -1487,7 +1487,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
progress.setTokenSent(true);
|
|
progress.setTokenSent(true);
|
|
}
|
|
}
|
|
|
|
|
|
- if (!progress.getSatisfiedMethods().contains(RecoveryVerificationMethods.TOKEN)) {
|
|
|
|
|
|
+ if (!progress.getSatisfiedMethods().contains(IdentityVerificationMethod.TOKEN)) {
|
|
pwmRequest.forwardToJsp(PwmConstants.JSP_URL.RECOVER_PASSWORD_ENTER_TOKEN);
|
|
pwmRequest.forwardToJsp(PwmConstants.JSP_URL.RECOVER_PASSWORD_ENTER_TOKEN);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1495,7 +1495,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
break;
|
|
break;
|
|
|
|
|
|
case REMOTE_RESPONSES: {
|
|
case REMOTE_RESPONSES: {
|
|
- final RecoveryVerificationMethod remoteMethod;
|
|
|
|
|
|
+ final VerificationMethodSystem remoteMethod;
|
|
if (forgottenPasswordBean.getProgress().getRemoteRecoveryMethod() == null) {
|
|
if (forgottenPasswordBean.getProgress().getRemoteRecoveryMethod() == null) {
|
|
remoteMethod = new RemoteVerificationMethod();
|
|
remoteMethod = new RemoteVerificationMethod();
|
|
remoteMethod.init(
|
|
remoteMethod.init(
|
|
@@ -1509,7 +1509,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
remoteMethod = forgottenPasswordBean.getProgress().getRemoteRecoveryMethod();
|
|
remoteMethod = forgottenPasswordBean.getProgress().getRemoteRecoveryMethod();
|
|
}
|
|
}
|
|
|
|
|
|
- final List<RecoveryVerificationMethod.UserPrompt> prompts = remoteMethod.getCurrentPrompts();
|
|
|
|
|
|
+ final List<VerificationMethodSystem.UserPrompt> prompts = remoteMethod.getCurrentPrompts();
|
|
final String displayInstructions = remoteMethod.getCurrentDisplayInstructions();
|
|
final String displayInstructions = remoteMethod.getCurrentDisplayInstructions();
|
|
|
|
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.ForgottenPasswordPrompts, new ArrayList<>(prompts));
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.ForgottenPasswordPrompts, new ArrayList<>(prompts));
|
|
@@ -1520,7 +1520,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
|
|
|
|
|
|
|
|
case NAAF: {
|
|
case NAAF: {
|
|
- final RecoveryVerificationMethod naafMethod;
|
|
|
|
|
|
+ final VerificationMethodSystem naafMethod;
|
|
if (forgottenPasswordBean.getProgress().getNaafRecoveryMethod() == null) {
|
|
if (forgottenPasswordBean.getProgress().getNaafRecoveryMethod() == null) {
|
|
naafMethod = new PwmNAAFVerificationMethod();
|
|
naafMethod = new PwmNAAFVerificationMethod();
|
|
naafMethod.init(
|
|
naafMethod.init(
|
|
@@ -1534,7 +1534,7 @@ public class ForgottenPasswordServlet extends AbstractPwmServlet {
|
|
naafMethod = forgottenPasswordBean.getProgress().getNaafRecoveryMethod();
|
|
naafMethod = forgottenPasswordBean.getProgress().getNaafRecoveryMethod();
|
|
}
|
|
}
|
|
|
|
|
|
- final List<RecoveryVerificationMethod.UserPrompt> prompts = naafMethod.getCurrentPrompts();
|
|
|
|
|
|
+ final List<VerificationMethodSystem.UserPrompt> prompts = naafMethod.getCurrentPrompts();
|
|
final String displayInstructions = naafMethod.getCurrentDisplayInstructions();
|
|
final String displayInstructions = naafMethod.getCurrentDisplayInstructions();
|
|
|
|
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.ForgottenPasswordPrompts, new ArrayList<>(prompts));
|
|
pwmRequest.setAttribute(PwmRequest.Attribute.ForgottenPasswordPrompts, new ArrayList<>(prompts));
|