|
@@ -436,7 +436,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
if ( configuredSearchFilter == null || configuredSearchFilter.isEmpty() )
|
|
|
{
|
|
|
searchFilter = FormUtility.ldapSearchFilterForForm( pwmApplication, forgottenPasswordForm );
|
|
|
- LOGGER.trace( pwmSession, "auto generated ldap search filter: " + searchFilter );
|
|
|
+ LOGGER.trace( pwmSession, () -> "auto generated ldap search filter: " + searchFilter );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -486,7 +486,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
pwmApplication.getIntruderManager().convenience().markAddressAndSession( pwmSession );
|
|
|
pwmApplication.getIntruderManager().convenience().markAttributes( formValues, pwmSession );
|
|
|
|
|
|
- LOGGER.debug( pwmSession, errorInfo.toDebugStr() );
|
|
|
+ LOGGER.debug( pwmSession, errorInfo );
|
|
|
setLastError( pwmRequest, errorInfo );
|
|
|
return ProcessStatus.Continue;
|
|
|
}
|
|
@@ -544,7 +544,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
}
|
|
|
catch ( PwmUnrecoverableException e )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "error while checking entered token: " );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "error while checking entered token: " );
|
|
|
errorInformation = e.getErrorInformation();
|
|
|
}
|
|
|
catch ( PwmOperationalException e )
|
|
@@ -600,7 +600,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
forgottenPasswordBean.getProgress().setRemoteRecoveryMethod( null );
|
|
|
pwmRequest.respondWithError( errorInformation, true );
|
|
|
handleUserVerificationBadAttempt( pwmRequest, forgottenPasswordBean, errorInformation );
|
|
|
- LOGGER.debug( pwmRequest, "unsuccessful remote response verification input: " + errorInformation.toDebugStr() );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "unsuccessful remote response verification input: " + errorInformation.toDebugStr() );
|
|
|
return ProcessStatus.Continue;
|
|
|
}
|
|
|
|
|
@@ -619,7 +619,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
{
|
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
|
|
|
final String userEnteredCode = pwmRequest.readParameterAsString( PwmConstants.PARAM_TOKEN );
|
|
|
- LOGGER.debug( pwmRequest, String.format( "entered OTP: %s", userEnteredCode ) );
|
|
|
+ LOGGER.debug( pwmRequest, () -> String.format( "entered OTP: %s", userEnteredCode ) );
|
|
|
|
|
|
final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest, forgottenPasswordBean );
|
|
|
final OTPUserRecord otpUserRecord = userInfo.getOtpUserRecord();
|
|
@@ -642,7 +642,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
if ( otpPassed )
|
|
|
{
|
|
|
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( IdentityVerificationMethod.OTP );
|
|
|
}
|
|
|
else
|
|
@@ -670,7 +670,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
|
|
|
if ( forgottenPasswordBean.getProgress().getInProgressVerificationMethod() != IdentityVerificationMethod.OAUTH )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "oauth return detected, however current session did not issue an oauth request; will restart forgotten password sequence" );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "oauth return detected, however current session did not issue an oauth request; will restart forgotten password sequence" );
|
|
|
pwmRequest.getPwmApplication().getSessionStateService().clearBean( pwmRequest, ForgottenPasswordBean.class );
|
|
|
pwmRequest.sendRedirect( PwmServletDefinition.ForgottenPassword );
|
|
|
return ProcessStatus.Halt;
|
|
@@ -678,7 +678,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
|
|
|
if ( forgottenPasswordBean.getUserIdentity() == null )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "oauth return detected, however current session does not have a user identity stored; will restart forgotten password sequence" );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "oauth return detected, however current session does not have a user identity stored; will restart forgotten password sequence" );
|
|
|
pwmRequest.getPwmApplication().getSessionStateService().clearBean( pwmRequest, ForgottenPasswordBean.class );
|
|
|
pwmRequest.sendRedirect( PwmServletDefinition.ForgottenPassword );
|
|
|
return ProcessStatus.Halt;
|
|
@@ -686,7 +686,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
|
|
|
final String encryptedResult = pwmRequest.readParameterAsString( PwmConstants.PARAM_RECOVERY_OAUTH_RESULT, PwmHttpRequestWrapper.Flag.BypassValidation );
|
|
|
final OAuthForgottenPasswordResults results = pwmRequest.getPwmApplication().getSecureService().decryptObject( encryptedResult, OAuthForgottenPasswordResults.class );
|
|
|
- LOGGER.trace( pwmRequest, "received " );
|
|
|
+ LOGGER.trace( pwmRequest, () -> "received" );
|
|
|
|
|
|
final String userDNfromOAuth = results.getUsername();
|
|
|
if ( userDNfromOAuth == null || userDNfromOAuth.isEmpty() )
|
|
@@ -781,7 +781,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
|
|
|
if ( responsesPassed )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "user '" + userIdentity + "' has supplied correct responses" );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "user '" + userIdentity + "' has supplied correct responses" );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -793,7 +793,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
}
|
|
|
catch ( ChaiValidationException e )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "chai validation error checking user responses: " + e.getMessage() );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "chai validation error checking user responses: " + e.getMessage() );
|
|
|
final ErrorInformation errorInformation = new ErrorInformation( PwmError.forChaiError( e.getErrorCode() ) );
|
|
|
handleUserVerificationBadAttempt( pwmRequest, forgottenPasswordBean, errorInformation );
|
|
|
return ProcessStatus.Continue;
|
|
@@ -830,7 +830,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
}
|
|
|
|
|
|
{
|
|
|
- LOGGER.trace( pwmRequest, "preparing to send a new token to user" );
|
|
|
+ LOGGER.trace( pwmRequest, () -> "preparing to send a new token to user" );
|
|
|
final long delayTime = Long.parseLong( pwmRequest.getConfig().readAppProperty( AppProperty.TOKEN_RESEND_DELAY_MS ) );
|
|
|
JavaHelper.pause( delayTime );
|
|
|
}
|
|
@@ -911,7 +911,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
{
|
|
|
if ( theUser.compareStringAttribute( attrName, entry.getValue() ) )
|
|
|
{
|
|
|
- LOGGER.trace( pwmRequest, "successful validation of ldap attribute value for '" + attrName + "'" );
|
|
|
+ LOGGER.trace( pwmRequest, () -> "successful validation of ldap attribute value for '" + attrName + "'" );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -970,7 +970,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
final String profileDebugMsg = forgottenPasswordProfile != null && profileIDList != null && profileIDList.size() > 1
|
|
|
? " profile=" + forgottenPasswordProfile.getIdentifier() + ", "
|
|
|
: "";
|
|
|
- LOGGER.trace( pwmRequest, "entering forgotten password progress engine: "
|
|
|
+ LOGGER.trace( pwmRequest, () -> "entering forgotten password progress engine: "
|
|
|
+ profileDebugMsg
|
|
|
+ "flags=" + JsonUtil.serialize( recoveryFlags ) + ", "
|
|
|
+ "progress=" + JsonUtil.serialize( progress ) );
|
|
@@ -993,7 +993,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
final String userGuid = LdapOperationsHelper.readLdapGuidValue( pwmApplication, pwmRequest.getSessionLabel(), userIdentity, true );
|
|
|
if ( ForgottenPasswordUtil.checkAuthRecord( pwmRequest, userGuid ) )
|
|
|
{
|
|
|
- LOGGER.debug( pwmRequest, "marking " + IdentityVerificationMethod.PREVIOUS_AUTH + " method as satisfied" );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "marking " + IdentityVerificationMethod.PREVIOUS_AUTH + " method as satisfied" );
|
|
|
progress.getSatisfiedMethods().add( IdentityVerificationMethod.PREVIOUS_AUTH );
|
|
|
}
|
|
|
}
|
|
@@ -1047,7 +1047,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
if ( remainingAvailableOptionalMethods.size() == 1 )
|
|
|
{
|
|
|
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 );
|
|
|
progress.setInProgressVerificationMethod( remainingMethod );
|
|
|
return;
|
|
@@ -1113,7 +1113,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
final boolean disallowAllButUnlock = minLifetimeOption == RecoveryMinLifetimeOption.UNLOCKONLY
|
|
|
&& userInfo.isPasswordLocked();
|
|
|
|
|
|
- LOGGER.trace( pwmRequest, "all recovery checks passed, proceeding to configured recovery action" );
|
|
|
+ LOGGER.trace( pwmRequest, () -> "all recovery checks passed, proceeding to configured recovery action" );
|
|
|
|
|
|
final RecoveryAction recoveryAction = ForgottenPasswordUtil.getRecoveryAction( config, forgottenPasswordBean );
|
|
|
if ( recoveryAction == RecoveryAction.SENDNEWPW || recoveryAction == RecoveryAction.SENDNEWPW_AND_EXPIRE )
|
|
@@ -1199,7 +1199,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
{
|
|
|
// try unlocking user
|
|
|
theUser.unlockPassword();
|
|
|
- LOGGER.trace( pwmSession, "unlock account succeeded" );
|
|
|
+ LOGGER.trace( pwmSession, () -> "unlock account succeeded" );
|
|
|
}
|
|
|
catch ( ChaiOperationException e )
|
|
|
{
|
|
@@ -1287,7 +1287,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
{
|
|
|
// execute configured actions
|
|
|
final ChaiUser proxiedUser = pwmApplication.getProxiedChaiUser( userIdentity );
|
|
|
- LOGGER.debug( pwmSession, "executing post-forgotten password configured actions to user " + proxiedUser.getEntryDN() );
|
|
|
+ LOGGER.debug( pwmSession, () -> "executing post-forgotten password configured actions to user " + proxiedUser.getEntryDN() );
|
|
|
final List<ActionConfiguration> configValues = pwmApplication.getConfig().readSettingAsAction( PwmSetting.FORGOTTEN_USER_POST_ACTIONS );
|
|
|
final ActionExecutor actionExecutor = new ActionExecutor.ActionExecutorSettings( pwmApplication, userIdentity )
|
|
|
.setMacroMachine( pwmSession.getSessionManager().getMacroMachine( pwmApplication ) )
|
|
@@ -1365,8 +1365,10 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- LOGGER.debug( pwmRequest, "user initiated forgotten password recovery using '" + forgottenPasswordBean.getUserLocale() + "' locale, but current request locale is now '"
|
|
|
- + pwmRequest.getLocale() + "', thus, the user progress will be restart and user data will be re-read using current locale" );
|
|
|
+ LOGGER.debug( pwmRequest, () -> "user initiated forgotten password recovery using '"
|
|
|
+ + forgottenPasswordBean.getUserLocale() + "' locale, but current request locale is now '"
|
|
|
+ + pwmRequest.getLocale()
|
|
|
+ + "', thus, the user progress will be restart and user data will be re-read using current locale" );
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -1394,7 +1396,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
|
|
|
)
|
|
|
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() );
|
|
|
final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
|
|
|
ForgottenPasswordUtil.verifyRequirementsForAuthMethod( pwmRequest, forgottenPasswordBean, method );
|
|
|
switch ( method )
|