Jelajahi Sumber

refactor rename commonvalues to pwmRequestScope

Jason Rivard 4 tahun lalu
induk
melakukan
3d9c6e1790
27 mengubah file dengan 294 tambahan dan 284 penghapusan
  1. 6 6
      server/src/main/java/password/pwm/config/profile/ProfileUtility.java
  2. 2 2
      server/src/main/java/password/pwm/http/PwmRequest.java
  3. 1 1
      server/src/main/java/password/pwm/http/PwmRequestContext.java
  4. 1 1
      server/src/main/java/password/pwm/http/servlet/ShortcutServlet.java
  5. 2 2
      server/src/main/java/password/pwm/http/servlet/activation/ActivateUserServlet.java
  6. 1 1
      server/src/main/java/password/pwm/http/servlet/activation/ActivateUserUtils.java
  7. 29 27
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordServlet.java
  8. 21 21
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStageProcessor.java
  9. 122 114
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStateMachine.java
  10. 48 48
      server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordUtil.java
  11. 1 1
      server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServletUtil.java
  12. 1 1
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java
  13. 1 1
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java
  14. 1 1
      server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchDataReader.java
  15. 1 1
      server/src/main/java/password/pwm/http/servlet/peoplesearch/PhotoDataReader.java
  16. 1 1
      server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileServlet.java
  17. 1 1
      server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileUtil.java
  18. 4 4
      server/src/main/java/password/pwm/ldap/UserInfoFactory.java
  19. 6 6
      server/src/main/java/password/pwm/ldap/auth/SessionAuthenticator.java
  20. 4 4
      server/src/main/java/password/pwm/ldap/permission/UserPermissionUtility.java
  21. 4 4
      server/src/main/java/password/pwm/svc/token/TokenService.java
  22. 15 15
      server/src/main/java/password/pwm/svc/token/TokenUtil.java
  23. 3 3
      server/src/main/java/password/pwm/util/macro/MacroRequest.java
  24. 1 1
      server/src/main/java/password/pwm/util/password/PasswordUtility.java
  25. 9 9
      server/src/main/java/password/pwm/util/secure/BeanCryptoMachine.java
  26. 3 3
      server/src/main/java/password/pwm/ws/server/RestRequest.java
  27. 5 5
      server/src/main/java/password/pwm/ws/server/rest/RestForgottenPasswordServer.java

+ 6 - 6
server/src/main/java/password/pwm/config/profile/ProfileUtility.java

@@ -29,7 +29,7 @@ import password.pwm.config.PwmSettingCategory;
 import password.pwm.config.value.data.UserPermission;
 import password.pwm.config.value.data.UserPermission;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.ldap.permission.UserPermissionUtility;
 import password.pwm.ldap.permission.UserPermissionUtility;
 import password.pwm.util.logging.PwmLogger;
 import password.pwm.util.logging.PwmLogger;
 
 
@@ -42,29 +42,29 @@ public class ProfileUtility
     private static final PwmLogger LOGGER = PwmLogger.forClass( ProfileUtility.class );
     private static final PwmLogger LOGGER = PwmLogger.forClass( ProfileUtility.class );
 
 
     public static Optional<String> discoverProfileIDForUser(
     public static Optional<String> discoverProfileIDForUser(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity,
             final UserIdentity userIdentity,
             final ProfileDefinition profileDefinition
             final ProfileDefinition profileDefinition
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        return discoverProfileIDForUser( commonValues.getPwmApplication(), commonValues.getSessionLabel(), userIdentity, profileDefinition );
+        return discoverProfileIDForUser( pwmRequestContext.getPwmApplication(), pwmRequestContext.getSessionLabel(), userIdentity, profileDefinition );
     }
     }
 
 
     public static <T extends Profile> T profileForUser(
     public static <T extends Profile> T profileForUser(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity,
             final UserIdentity userIdentity,
             final ProfileDefinition profileDefinition,
             final ProfileDefinition profileDefinition,
             final Class<T> classOfT
             final Class<T> classOfT
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final Optional<String> profileID = discoverProfileIDForUser( commonValues, userIdentity, profileDefinition );
+        final Optional<String> profileID = discoverProfileIDForUser( pwmRequestContext, userIdentity, profileDefinition );
         if ( !profileID.isPresent() )
         if ( !profileID.isPresent() )
         {
         {
             throw PwmUnrecoverableException.newException( PwmError.ERROR_NO_PROFILE_ASSIGNED, "profile of type " + profileDefinition + " is required but not assigned" );
             throw PwmUnrecoverableException.newException( PwmError.ERROR_NO_PROFILE_ASSIGNED, "profile of type " + profileDefinition + " is required but not assigned" );
         }
         }
-        final Profile profileImpl = commonValues.getConfig().profileMap( profileDefinition ).get( profileID.get() );
+        final Profile profileImpl = pwmRequestContext.getConfig().profileMap( profileDefinition ).get( profileID.get() );
         return ( T ) profileImpl;
         return ( T ) profileImpl;
     }
     }
 
 

+ 2 - 2
server/src/main/java/password/pwm/http/PwmRequest.java

@@ -597,9 +597,9 @@ public class PwmRequest extends PwmHttpRequestWrapper
         return false;
         return false;
     }
     }
 
 
-    public CommonValues commonValues()
+    public PwmRequestContext getPwmRequestContext()
     {
     {
-        return new CommonValues( pwmApplication, this.getLabel(), this.getLocale(), pwmRequestID );
+        return new PwmRequestContext( pwmApplication, this.getLabel(), this.getLocale(), pwmRequestID );
     }
     }
 
 
     public String getPwmRequestID()
     public String getPwmRequestID()

+ 1 - 1
server/src/main/java/password/pwm/http/CommonValues.java → server/src/main/java/password/pwm/http/PwmRequestContext.java

@@ -29,7 +29,7 @@ import password.pwm.http.servlet.PwmRequestID;
 import java.util.Locale;
 import java.util.Locale;
 
 
 @Value
 @Value
-public class CommonValues
+public class PwmRequestContext
 {
 {
     final PwmApplication pwmApplication;
     final PwmApplication pwmApplication;
     final SessionLabel sessionLabel;
     final SessionLabel sessionLabel;

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/ShortcutServlet.java

@@ -197,7 +197,7 @@ public class ShortcutServlet extends AbstractPwmServlet
                         .build();
                         .build();
 
 
                 final boolean queryMatch = UserPermissionUtility.testUserPermission(
                 final boolean queryMatch = UserPermissionUtility.testUserPermission(
-                        pwmRequest.commonValues(),
+                        pwmRequest.getPwmRequestContext(),
                         pwmRequest.getPwmSession().getUserInfo().getUserIdentity(),
                         pwmRequest.getPwmSession().getUserInfo().getUserIdentity(),
                         userPermission
                         userPermission
                 );
                 );

+ 2 - 2
server/src/main/java/password/pwm/http/servlet/activation/ActivateUserServlet.java

@@ -330,7 +330,7 @@ public class ActivateUserServlet extends ControlledPwmServlet
         try
         try
         {
         {
             final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
             final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
-                    pwmRequest.commonValues(),
+                    pwmRequest.getPwmRequestContext(),
                     userEnteredCode,
                     userEnteredCode,
                     activateUserBean.getTokenDestination(),
                     activateUserBean.getTokenDestination(),
                     activateUserBean.getUserIdentity(),
                     activateUserBean.getUserIdentity(),
@@ -440,7 +440,7 @@ public class ActivateUserServlet extends ControlledPwmServlet
             if ( !activateUserBean.isTokenSent() && activateUserBean.getTokenDestination() != null )
             if ( !activateUserBean.isTokenSent() && activateUserBean.getTokenDestination() != null )
             {
             {
                 TokenUtil.initializeAndSendToken(
                 TokenUtil.initializeAndSendToken(
-                        pwmRequest.commonValues(),
+                        pwmRequest.getPwmRequestContext(),
                         TokenUtil.TokenInitAndSendRequest.builder()
                         TokenUtil.TokenInitAndSendRequest.builder()
                                 .userInfo( userInfo )
                                 .userInfo( userInfo )
                                 .tokenDestinationItem( activateUserBean.getTokenDestination() )
                                 .tokenDestinationItem( activateUserBean.getTokenDestination() )

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/activation/ActivateUserUtils.java

@@ -342,7 +342,7 @@ class ActivateUserUtils
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final ActivateUserBean activateUserBean = pwmApplication.getSessionStateService().getBean( pwmRequest, ActivateUserBean.class );
         final ActivateUserBean activateUserBean = pwmApplication.getSessionStateService().getBean( pwmRequest, ActivateUserBean.class );
 
 
-        final Optional<String> profileID = ProfileUtility.discoverProfileIDForUser( pwmRequest.commonValues(), userIdentity, ProfileDefinition.ActivateUser );
+        final Optional<String> profileID = ProfileUtility.discoverProfileIDForUser( pwmRequest.getPwmRequestContext(), userIdentity, ProfileDefinition.ActivateUser );
 
 
         if ( !profileID.isPresent() || !pwmApplication.getConfig().getUserActivationProfiles().containsKey( profileID.get() ) )
         if ( !profileID.isPresent() || !pwmApplication.getConfig().getUserActivationProfiles().containsKey( profileID.get() ) )
         {
         {

+ 29 - 27
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordServlet.java

@@ -245,7 +245,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
 
 
         final boolean disallowAllButUnlock;
         final boolean disallowAllButUnlock;
         {
         {
-            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
             final RecoveryMinLifetimeOption minLifetimeOption = forgottenPasswordProfile.readSettingAsEnum(
             final RecoveryMinLifetimeOption minLifetimeOption = forgottenPasswordProfile.readSettingAsEnum(
                     PwmSetting.RECOVERY_MINIMUM_PASSWORD_LIFETIME_OPTIONS,
                     PwmSetting.RECOVERY_MINIMUM_PASSWORD_LIFETIME_OPTIONS,
                     RecoveryMinLifetimeOption.class
                     RecoveryMinLifetimeOption.class
@@ -271,7 +271,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
                     case resetPassword:
                     case resetPassword:
                         if ( disallowAllButUnlock )
                         if ( disallowAllButUnlock )
                         {
                         {
-                            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+                            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
                             PasswordUtility.throwPasswordTooSoonException( userInfo, pwmRequest.getLabel() );
                             PasswordUtility.throwPasswordTooSoonException( userInfo, pwmRequest.getLabel() );
                         }
                         }
                         this.executeResetPassword( pwmRequest );
                         this.executeResetPassword( pwmRequest );
@@ -327,7 +327,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
-        final List<TokenDestinationItem> items = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.commonValues(), forgottenPasswordBean );
+        final List<TokenDestinationItem> items = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
 
 
         final String requestedID = pwmRequest.readParameterAsString( "choice", PwmHttpRequestWrapper.Flag.BypassValidation );
         final String requestedID = pwmRequest.readParameterAsString( "choice", PwmHttpRequestWrapper.Flag.BypassValidation );
 
 
@@ -347,7 +347,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
         final String requestedChoiceStr = pwmRequest.readParameterAsString( PwmConstants.PARAM_METHOD_CHOICE );
         final String requestedChoiceStr = pwmRequest.readParameterAsString( PwmConstants.PARAM_METHOD_CHOICE );
         final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
         final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
-                ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( pwmRequest.commonValues(), forgottenPasswordBean )
+                ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( pwmRequest.getPwmRequestContext(), forgottenPasswordBean )
         );
         );
         pwmRequest.setAttribute( PwmRequestAttribute.AvailableAuthMethods, remainingAvailableOptionalMethods );
         pwmRequest.setAttribute( PwmRequestAttribute.AvailableAuthMethods, remainingAvailableOptionalMethods );
 
 
@@ -465,7 +465,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             AuthenticationUtility.checkIfUserEligibleToAuthentication( pwmApplication, userIdentity );
             AuthenticationUtility.checkIfUserEligibleToAuthentication( pwmApplication, userIdentity );
 
 
             final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
             final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
-            ForgottenPasswordUtil.initForgottenPasswordBean( pwmRequest.commonValues(), userIdentity, forgottenPasswordBean );
+            ForgottenPasswordUtil.initForgottenPasswordBean( pwmRequest.getPwmRequestContext(), userIdentity, forgottenPasswordBean );
 
 
             // clear intruder search values
             // clear intruder search values
             pwmApplication.getIntruderManager().convenience().clearAttributes( formValues );
             pwmApplication.getIntruderManager().convenience().clearAttributes( formValues );
@@ -493,7 +493,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
 
 
         if ( bogusUserModeEnabled )
         if ( bogusUserModeEnabled )
         {
         {
-            ForgottenPasswordUtil.initBogusForgottenPasswordBean( pwmRequest.commonValues(), forgottenPasswordBean( pwmRequest ) );
+            ForgottenPasswordUtil.initBogusForgottenPasswordBean( pwmRequest.getPwmRequestContext(), forgottenPasswordBean( pwmRequest ) );
             forgottenPasswordBean( pwmRequest ).setUserSearchValues( FormUtility.asStringMap( formValues ) );
             forgottenPasswordBean( pwmRequest ).setUserSearchValues( FormUtility.asStringMap( formValues ) );
         }
         }
 
 
@@ -511,7 +511,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         try
         try
         {
         {
             final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
             final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
-                    pwmRequest.commonValues(),
+                    pwmRequest.getPwmRequestContext(),
                     userEnteredCode,
                     userEnteredCode,
                     forgottenPasswordBean.getProgress().getTokenDestination(),
                     forgottenPasswordBean.getProgress().getTokenDestination(),
                     null,
                     null,
@@ -524,7 +524,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             {
             {
                 // clean session, user supplied token (clicked email, etc) and this is first request
                 // clean session, user supplied token (clicked email, etc) and this is first request
                 ForgottenPasswordUtil.initForgottenPasswordBean(
                 ForgottenPasswordUtil.initForgottenPasswordBean(
-                        pwmRequest.commonValues(),
+                        pwmRequest.getPwmRequestContext(),
                         tokenPayload.getUserIdentity(),
                         tokenPayload.getUserIdentity(),
                         forgottenPasswordBean
                         forgottenPasswordBean
                 );
                 );
@@ -605,7 +605,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         final String userEnteredCode = pwmRequest.readParameterAsString( PwmConstants.PARAM_TOKEN );
         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.commonValues(), forgottenPasswordBean );
+        final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
         final OTPUserRecord otpUserRecord = userInfo.getOtpUserRecord();
         final OTPUserRecord otpUserRecord = userInfo.getOtpUserRecord();
 
 
         final boolean otpPassed;
         final boolean otpPassed;
@@ -727,7 +727,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         }
         }
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
 
 
-        final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( pwmRequest.commonValues(), forgottenPasswordBean );
+        final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
         if ( responseSet == null )
         if ( responseSet == null )
         {
         {
             final String errorMsg = "attempt to check responses, but responses are not loaded into session bean";
             final String errorMsg = "attempt to check responses, but responses are not loaded into session bean";
@@ -820,9 +820,9 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         }
         }
 
 
         {
         {
-            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
             final TokenDestinationItem tokenDestinationItem = forgottenPasswordBean.getProgress().getTokenDestination();
             final TokenDestinationItem tokenDestinationItem = forgottenPasswordBean.getProgress().getTokenDestination();
-            ForgottenPasswordUtil.initializeAndSendToken( pwmRequest.commonValues(), userInfo, tokenDestinationItem );
+            ForgottenPasswordUtil.initializeAndSendToken( pwmRequest.getPwmRequestContext(), userInfo, tokenDestinationItem );
         }
         }
 
 
         final RestResultBean restResultBean = RestResultBean.forSuccessMessage( pwmRequest, Message.Success_TokenResend );
         final RestResultBean restResultBean = RestResultBean.forSuccessMessage( pwmRequest, Message.Success_TokenResend );
@@ -1043,7 +1043,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             if ( satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods() )
             if ( satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods() )
             {
             {
                 final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
                 final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
-                        pwmRequest.commonValues(),
+                        pwmRequest.getPwmRequestContext(),
                         forgottenPasswordBean
                         forgottenPasswordBean
                 );
                 );
                 if ( remainingAvailableOptionalMethods.isEmpty() )
                 if ( remainingAvailableOptionalMethods.isEmpty() )
@@ -1099,7 +1099,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             StatisticsManager.incrementStat( pwmRequest, Statistic.RECOVERY_SUCCESSES );
             StatisticsManager.incrementStat( pwmRequest, Statistic.RECOVERY_SUCCESSES );
         }
         }
 
 
-        final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+        final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
         if ( userInfo == null )
         if ( userInfo == null )
         {
         {
             throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, "unable to load userInfo while processing forgotten password controller" );
             throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, "unable to load userInfo while processing forgotten password controller" );
@@ -1174,10 +1174,10 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             theUser.unlockPassword();
             theUser.unlockPassword();
 
 
             // mark the event log
             // mark the event log
-            final UserInfo userInfoBean = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+            final UserInfo userInfoBean = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
             pwmApplication.getAuditManager().submit( AuditEvent.UNLOCK_PASSWORD, userInfoBean, pwmSession );
             pwmApplication.getAuditManager().submit( AuditEvent.UNLOCK_PASSWORD, userInfoBean, pwmSession );
 
 
-            ForgottenPasswordUtil.sendUnlockNoticeEmail( pwmRequest.commonValues(), forgottenPasswordBean );
+            ForgottenPasswordUtil.sendUnlockNoticeEmail( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
 
 
             pwmRequest.getPwmResponse().forwardToSuccessPage( Message.Success_UnlockAccount );
             pwmRequest.getPwmResponse().forwardToSuccessPage( Message.Success_UnlockAccount );
         }
         }
@@ -1308,7 +1308,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         try
         try
         {
         {
             ForgottenPasswordUtil.initForgottenPasswordBean(
             ForgottenPasswordUtil.initForgottenPasswordBean(
-                    pwmRequest.commonValues(),
+                    pwmRequest.getPwmRequestContext(),
                     forgottenPasswordBean.getUserIdentity(),
                     forgottenPasswordBean.getUserIdentity(),
                     forgottenPasswordBean
                     forgottenPasswordBean
             );
             );
@@ -1333,7 +1333,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
     {
     {
         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 );
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
-        ForgottenPasswordUtil.verifyRequirementsForAuthMethod( pwmRequest.commonValues(), forgottenPasswordBean, method );
+        ForgottenPasswordUtil.verifyRequirementsForAuthMethod( pwmRequest.getPwmRequestContext(), forgottenPasswordBean, method );
         switch ( method )
         switch ( method )
         {
         {
             case PREVIOUS_AUTH:
             case PREVIOUS_AUTH:
@@ -1362,7 +1362,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             {
             {
                 pwmRequest.setAttribute(
                 pwmRequest.setAttribute(
                         PwmRequestAttribute.ForgottenPasswordOtpRecord,
                         PwmRequestAttribute.ForgottenPasswordOtpRecord,
-                        ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean ).getOtpUserRecord()
+                        ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean ).getOtpUserRecord()
                 );
                 );
                 pwmRequest.forwardToJsp( JspUrl.RECOVER_PASSWORD_ENTER_OTP );
                 pwmRequest.forwardToJsp( JspUrl.RECOVER_PASSWORD_ENTER_OTP );
             }
             }
@@ -1371,7 +1371,9 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             case TOKEN:
             case TOKEN:
             {
             {
                 final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
                 final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
-                final List<TokenDestinationItem> tokenDestinations = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.commonValues(), forgottenPasswordBean );
+                final List<TokenDestinationItem> tokenDestinations =
+                        ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
+
                 if ( progress.getTokenDestination() == null )
                 if ( progress.getTokenDestination() == null )
                 {
                 {
                     final boolean autoSelect = Boolean.parseBoolean( pwmRequest.getConfig().readAppProperty( AppProperty.FORGOTTEN_PASSWORD_TOKEN_AUTO_SELECT_DEST ) );
                     final boolean autoSelect = Boolean.parseBoolean( pwmRequest.getConfig().readAppProperty( AppProperty.FORGOTTEN_PASSWORD_TOKEN_AUTO_SELECT_DEST ) );
@@ -1390,8 +1392,8 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
 
 
                 if ( !progress.isTokenSent() )
                 if ( !progress.isTokenSent() )
                 {
                 {
-                    final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
-                    ForgottenPasswordUtil.initializeAndSendToken( pwmRequest.commonValues(), userInfo, progress.getTokenDestination() );
+                    final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
+                    ForgottenPasswordUtil.initializeAndSendToken( pwmRequest.getPwmRequestContext(), userInfo, progress.getTokenDestination() );
                     progress.setTokenSent( true );
                     progress.setTokenSent( true );
                 }
                 }
 
 
@@ -1405,7 +1407,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
 
 
             case REMOTE_RESPONSES:
             case REMOTE_RESPONSES:
             {
             {
-                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.commonValues(), forgottenPasswordBean );
+                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
                 final VerificationMethodSystem remoteMethod;
                 final VerificationMethodSystem remoteMethod;
                 if ( forgottenPasswordBean.getProgress().getRemoteRecoveryMethod() == null )
                 if ( forgottenPasswordBean.getProgress().getRemoteRecoveryMethod() == null )
                 {
                 {
@@ -1453,10 +1455,10 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
             throws ServletException, PwmUnrecoverableException, IOException
             throws ServletException, PwmUnrecoverableException, IOException
     {
     {
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
         final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordBean( pwmRequest );
-        final List<TokenDestinationItem> destItems = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.commonValues(), forgottenPasswordBean );
+        final List<TokenDestinationItem> destItems = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
         pwmRequest.setAttribute( PwmRequestAttribute.TokenDestItems, new ArrayList<>( destItems ) );
         pwmRequest.setAttribute( PwmRequestAttribute.TokenDestItems, new ArrayList<>( destItems ) );
 
 
-        if ( ForgottenPasswordUtil.hasOtherMethodChoices( pwmRequest.commonValues(), forgottenPasswordBean, IdentityVerificationMethod.TOKEN ) )
+        if ( ForgottenPasswordUtil.hasOtherMethodChoices( pwmRequest.getPwmRequestContext(), forgottenPasswordBean, IdentityVerificationMethod.TOKEN ) )
         {
         {
             pwmRequest.setAttribute( PwmRequestAttribute.GoBackAction, ResetAction.clearActionChoice.name() );
             pwmRequest.setAttribute( PwmRequestAttribute.GoBackAction, ResetAction.clearActionChoice.name() );
         }
         }
@@ -1473,7 +1475,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
                 forgottenPasswordBean
                 forgottenPasswordBean
         );
         );
 
 
-        final List<TokenDestinationItem> destItems = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.commonValues(), forgottenPasswordBean );
+        final List<TokenDestinationItem> destItems = ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequest.getPwmRequestContext(), forgottenPasswordBean );
 
 
         ResetAction goBackAction = null;
         ResetAction goBackAction = null;
 
 
@@ -1482,7 +1484,7 @@ public class ForgottenPasswordServlet extends ControlledPwmServlet
         {
         {
             goBackAction = ResetAction.clearTokenDestination;
             goBackAction = ResetAction.clearTokenDestination;
         }
         }
-        else if ( ForgottenPasswordUtil.hasOtherMethodChoices( pwmRequest.commonValues(), forgottenPasswordBean, IdentityVerificationMethod.TOKEN ) )
+        else if ( ForgottenPasswordUtil.hasOtherMethodChoices( pwmRequest.getPwmRequestContext(), forgottenPasswordBean, IdentityVerificationMethod.TOKEN ) )
         {
         {
             goBackAction = ResetAction.clearActionChoice;
             goBackAction = ResetAction.clearActionChoice;
         }
         }

+ 21 - 21
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStageProcessor.java

@@ -32,7 +32,7 @@ import password.pwm.config.profile.ForgottenPasswordProfile;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.PwmRequestAttribute;
 import password.pwm.http.PwmRequestAttribute;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordStage;
 import password.pwm.http.bean.ForgottenPasswordStage;
@@ -94,7 +94,7 @@ class ForgottenPasswordStageProcessor
         @Override
         @Override
         public Optional<ForgottenPasswordStage> nextStage( final ForgottenPasswordStateMachine stateMachine )
         public Optional<ForgottenPasswordStage> nextStage( final ForgottenPasswordStateMachine stateMachine )
         {
         {
-            final CommonValues commonValues = stateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
 
 
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             stateMachine.getRequestFlags().clear();
             stateMachine.getRequestFlags().clear();
@@ -108,12 +108,12 @@ class ForgottenPasswordStageProcessor
             // check locale
             // check locale
             if ( forgottenPasswordBean.getUserLocale() == null )
             if ( forgottenPasswordBean.getUserLocale() == null )
             {
             {
-                forgottenPasswordBean.setUserLocale( commonValues.getLocale() );
+                forgottenPasswordBean.setUserLocale( pwmRequestContext.getLocale() );
             }
             }
 
 
-            if ( !Objects.equals( forgottenPasswordBean.getUserLocale(), commonValues.getLocale() ) )
+            if ( !Objects.equals( forgottenPasswordBean.getUserLocale(), pwmRequestContext.getLocale() ) )
             {
             {
-                LOGGER.debug( commonValues.getSessionLabel(), () -> "user locale has changed, resetting forgotten password state" );
+                LOGGER.debug( pwmRequestContext.getSessionLabel(), () -> "user locale has changed, resetting forgotten password state" );
                 stateMachine.clear();
                 stateMachine.clear();
                 return Optional.of( ForgottenPasswordStage.IDENTIFICATION );
                 return Optional.of( ForgottenPasswordStage.IDENTIFICATION );
             }
             }
@@ -136,9 +136,9 @@ class ForgottenPasswordStageProcessor
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
-            final CommonValues commonValues = stateMachine.getCommonValues();
-            final PwmApplication pwmApplication = commonValues.getPwmApplication();
-            final SessionLabel sessionLabel = commonValues.getSessionLabel();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
+            final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+            final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
             final Configuration config = pwmApplication.getConfig();
             final Configuration config = pwmApplication.getConfig();
 
 
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
@@ -220,8 +220,8 @@ class ForgottenPasswordStageProcessor
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
-            final CommonValues commonValues = stateMachine.getCommonValues();
-            final SessionLabel sessionLabel = commonValues.getSessionLabel();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
+            final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
 
 
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
             final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
             final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
@@ -233,7 +233,7 @@ class ForgottenPasswordStageProcessor
                 if ( satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods() )
                 if ( satisfiedOptionalMethods.size() < recoveryFlags.getMinimumOptionalAuthMethods() )
                 {
                 {
                     final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
                     final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
-                            commonValues,
+                            pwmRequestContext,
                             forgottenPasswordBean
                             forgottenPasswordBean
                     );
                     );
 
 
@@ -282,8 +282,8 @@ class ForgottenPasswordStageProcessor
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
-            final CommonValues commonValues = stateMachine.getCommonValues();
-            final SessionLabel sessionLabel = commonValues.getSessionLabel();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
+            final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
 
 
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
             final ForgottenPasswordBean.RecoveryFlags recoveryFlags = forgottenPasswordBean.getRecoveryFlags();
             final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
             final ForgottenPasswordBean.Progress progress = forgottenPasswordBean.getProgress();
@@ -322,9 +322,9 @@ class ForgottenPasswordStageProcessor
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
-            final CommonValues commonValues = stateMachine.getCommonValues();
-            final PwmApplication pwmApplication = commonValues.getPwmApplication();
-            final SessionLabel sessionLabel = commonValues.getSessionLabel();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
+            final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+            final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
 
 
             if ( !forgottenPasswordBean.getProgress().isAllPassed() )
             if ( !forgottenPasswordBean.getProgress().isAllPassed() )
             {
             {
@@ -332,7 +332,7 @@ class ForgottenPasswordStageProcessor
                 pwmApplication.getStatisticsManager().incrementValue( Statistic.RECOVERY_SUCCESSES );
                 pwmApplication.getStatisticsManager().incrementValue( Statistic.RECOVERY_SUCCESSES );
             }
             }
 
 
-            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordBean );
+            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordBean );
             if ( userInfo == null )
             if ( userInfo == null )
             {
             {
                 throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, "unable to load userInfo while processing forgotten password controller" );
                 throw PwmUnrecoverableException.newException( PwmError.ERROR_INTERNAL, "unable to load userInfo while processing forgotten password controller" );
@@ -367,12 +367,12 @@ class ForgottenPasswordStageProcessor
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = stateMachine.getForgottenPasswordBean();
-            final CommonValues commonValues = stateMachine.getCommonValues();
-            final PwmApplication pwmApplication = commonValues.getPwmApplication();
-            final SessionLabel sessionLabel = commonValues.getSessionLabel();
+            final PwmRequestContext pwmRequestContext = stateMachine.getCommonValues();
+            final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+            final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
             final Configuration config = pwmApplication.getConfig();
             final Configuration config = pwmApplication.getConfig();
 
 
-            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordBean );
+            final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordBean );
 
 
             final ForgottenPasswordProfile forgottenPasswordProfile = ForgottenPasswordUtil.forgottenPasswordProfile( pwmApplication, forgottenPasswordBean );
             final ForgottenPasswordProfile forgottenPasswordProfile = ForgottenPasswordUtil.forgottenPasswordProfile( pwmApplication, forgottenPasswordBean );
 
 

+ 122 - 114
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordStateMachine.java

@@ -47,7 +47,7 @@ import password.pwm.error.PwmDataValidationException;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.PwmRequestAttribute;
 import password.pwm.http.PwmRequestAttribute;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordStage;
 import password.pwm.http.bean.ForgottenPasswordStage;
@@ -123,16 +123,16 @@ public class ForgottenPasswordStateMachine
     }
     }
 
 
     private ForgottenPasswordBean forgottenPasswordBean;
     private ForgottenPasswordBean forgottenPasswordBean;
-    private final CommonValues commonValues;
+    private final PwmRequestContext pwmRequestContext;
     private final Map<PwmRequestAttribute, String> requestFlags = new ConcurrentHashMap<>();
     private final Map<PwmRequestAttribute, String> requestFlags = new ConcurrentHashMap<>();
 
 
     public ForgottenPasswordStateMachine(
     public ForgottenPasswordStateMachine(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        this.commonValues = commonValues;
+        this.pwmRequestContext = pwmRequestContext;
         updateBean( forgottenPasswordBean );
         updateBean( forgottenPasswordBean );
         nextStage();
         nextStage();
     }
     }
@@ -149,9 +149,9 @@ public class ForgottenPasswordStateMachine
         return forgottenPasswordBean;
         return forgottenPasswordBean;
     }
     }
 
 
-    CommonValues getCommonValues()
+    PwmRequestContext getCommonValues()
     {
     {
-        return commonValues;
+        return pwmRequestContext;
     }
     }
 
 
     static Set<IdentityVerificationMethod> supportedVerificationMethods()
     static Set<IdentityVerificationMethod> supportedVerificationMethods()
@@ -224,10 +224,10 @@ public class ForgottenPasswordStateMachine
         @Override
         @Override
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             return PresentableForm.builder()
             return PresentableForm.builder()
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ChangePassword, commonValues.getConfig() ) )
-                    .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Message.Success_PasswordChange, commonValues.getConfig() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ChangePassword, pwmRequestContext.getConfig() ) )
+                    .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Message.Success_PasswordChange, pwmRequestContext.getConfig() ) )
                     .build();
                     .build();
         }
         }
     }
     }
@@ -240,11 +240,11 @@ public class ForgottenPasswordStateMachine
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final PasswordData password1 = PasswordData.forStringValue( formValues.get( PARAM_PASSWORD ) );
             final PasswordData password1 = PasswordData.forStringValue( formValues.get( PARAM_PASSWORD ) );
             final PasswordData password2 = PasswordData.forStringValue( formValues.get( PARAM_PASSWORD_CONFIRM ) );
             final PasswordData password2 = PasswordData.forStringValue( formValues.get( PARAM_PASSWORD_CONFIRM ) );
 
 
-            final UserInfo userInfo = UserInfoFactory.newUserInfoUsingProxy( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity() );
+            final UserInfo userInfo = UserInfoFactory.newUserInfoUsingProxy( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity() );
             final boolean caseSensitive = userInfo.getPasswordPolicy().getRuleHelper().readBooleanValue(
             final boolean caseSensitive = userInfo.getPasswordPolicy().getRuleHelper().readBooleanValue(
                     PwmPasswordRule.CaseSensitive );
                     PwmPasswordRule.CaseSensitive );
             if ( PasswordUtility.PasswordCheckInfo.MatchStatus.MATCH != PasswordUtility.figureMatchStatus( caseSensitive,
             if ( PasswordUtility.PasswordCheckInfo.MatchStatus.MATCH != PasswordUtility.figureMatchStatus( caseSensitive,
@@ -260,9 +260,9 @@ public class ForgottenPasswordStateMachine
                 if ( verifyOnly )
                 if ( verifyOnly )
                 {
                 {
                     final PasswordUtility.PasswordCheckInfo passwordCheckInfo = PasswordUtility.checkEnteredPassword(
                     final PasswordUtility.PasswordCheckInfo passwordCheckInfo = PasswordUtility.checkEnteredPassword(
-                            commonValues.getPwmApplication(),
-                            commonValues.getLocale(),
-                            commonValues.getPwmApplication().getProxiedChaiUser( userInfo.getUserIdentity() ),
+                            pwmRequestContext.getPwmApplication(),
+                            pwmRequestContext.getLocale(),
+                            pwmRequestContext.getPwmApplication().getProxiedChaiUser( userInfo.getUserIdentity() ),
                             userInfo,
                             userInfo,
                             null,
                             null,
                             password1,
                             password1,
@@ -302,15 +302,15 @@ public class ForgottenPasswordStateMachine
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final Configuration config = forgottenPasswordStateMachine.getCommonValues().getConfig();
             final Configuration config = forgottenPasswordStateMachine.getCommonValues().getConfig();
             final Locale locale = forgottenPasswordStateMachine.getCommonValues().getLocale();
             final Locale locale = forgottenPasswordStateMachine.getCommonValues().getLocale();
             final UserIdentity userIdentity = forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity();
             final UserIdentity userIdentity = forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity();
-            final UserInfo userInfo = UserInfoFactory.newUserInfoUsingProxy( commonValues, userIdentity );
-            final MacroRequest macroRequest = MacroRequest.forUser( commonValues, userIdentity );
+            final UserInfo userInfo = UserInfoFactory.newUserInfoUsingProxy( pwmRequestContext, userIdentity );
+            final MacroRequest macroRequest = MacroRequest.forUser( pwmRequestContext, userIdentity );
             final PwmPasswordPolicy pwmPasswordPolicy = userInfo.getPasswordPolicy();
             final PwmPasswordPolicy pwmPasswordPolicy = userInfo.getPasswordPolicy();
 
 
-            final boolean valueMasking = commonValues.getConfig().readSettingAsBoolean( PwmSetting.DISPLAY_MASK_PASSWORD_FIELDS );
+            final boolean valueMasking = pwmRequestContext.getConfig().readSettingAsBoolean( PwmSetting.DISPLAY_MASK_PASSWORD_FIELDS );
             final FormConfiguration.Type formType = valueMasking
             final FormConfiguration.Type formType = valueMasking
                     ? FormConfiguration.Type.password
                     ? FormConfiguration.Type.password
                     : FormConfiguration.Type.text;
                     : FormConfiguration.Type.text;
@@ -331,16 +331,16 @@ public class ForgottenPasswordStateMachine
 
 
             final List<String> passwordRequirementsList = PasswordRequirementsTag.getPasswordRequirementsStrings(
             final List<String> passwordRequirementsList = PasswordRequirementsTag.getPasswordRequirementsStrings(
                     pwmPasswordPolicy,
                     pwmPasswordPolicy,
-                    commonValues.getConfig(),
-                    commonValues.getLocale(),
+                    pwmRequestContext.getConfig(),
+                    pwmRequestContext.getLocale(),
                     macroRequest );
                     macroRequest );
 
 
-            final String ruleDelimiter = commonValues.getConfig().readAppProperty( AppProperty.REST_SERVER_FORGOTTEN_PW_RULE_DELIMITER );
+            final String ruleDelimiter = pwmRequestContext.getConfig().readAppProperty( AppProperty.REST_SERVER_FORGOTTEN_PW_RULE_DELIMITER );
             final String ruleText = StringUtil.collectionToString( passwordRequirementsList, ruleDelimiter );
             final String ruleText = StringUtil.collectionToString( passwordRequirementsList, ruleDelimiter );
 
 
             return PresentableForm.builder()
             return PresentableForm.builder()
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ChangePassword, commonValues.getConfig() ) )
-                    .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_ChangePassword, commonValues.getConfig() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ChangePassword, pwmRequestContext.getConfig() ) )
+                    .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_ChangePassword, pwmRequestContext.getConfig() ) )
                     .messageDetail( ruleText )
                     .messageDetail( ruleText )
                     .formRows( formRows )
                     .formRows( formRows )
                     .build();
                     .build();
@@ -392,7 +392,7 @@ public class ForgottenPasswordStateMachine
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final List<TokenDestinationItem> tokenDestinationItems = ForgottenPasswordUtil.figureAvailableTokenDestinations(
             final List<TokenDestinationItem> tokenDestinationItems = ForgottenPasswordUtil.figureAvailableTokenDestinations(
                     forgottenPasswordStateMachine.getCommonValues(),
                     forgottenPasswordStateMachine.getCommonValues(),
                     forgottenPasswordStateMachine.getForgottenPasswordBean() );
                     forgottenPasswordStateMachine.getForgottenPasswordBean() );
@@ -401,20 +401,20 @@ public class ForgottenPasswordStateMachine
 
 
             for ( final TokenDestinationItem item : tokenDestinationItems )
             for ( final TokenDestinationItem item : tokenDestinationItems )
             {
             {
-                selectOptions.put( item.getId(), item.longDisplay( commonValues.getLocale(), commonValues.getConfig() ) );
+                selectOptions.put( item.getId(), item.longDisplay( pwmRequestContext.getLocale(), pwmRequestContext.getConfig() ) );
             }
             }
 
 
             final PresentableFormRow formRow = PresentableFormRow.builder()
             final PresentableFormRow formRow = PresentableFormRow.builder()
                     .name( PwmConstants.PARAM_TOKEN )
                     .name( PwmConstants.PARAM_TOKEN )
                     .type( FormConfiguration.Type.select )
                     .type( FormConfiguration.Type.select )
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Button_Select, commonValues.getConfig() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Button_Select, pwmRequestContext.getConfig() ) )
                     .selectOptions( selectOptions )
                     .selectOptions( selectOptions )
                     .required( true )
                     .required( true )
                     .build();
                     .build();
 
 
             return PresentableForm.builder()
             return PresentableForm.builder()
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
-                    .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverTokenSendChoices, commonValues.getConfig() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                    .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverTokenSendChoices, pwmRequestContext.getConfig() ) )
                     .formRow( formRow )
                     .formRow( formRow )
                     .build();
                     .build();
         }
         }
@@ -476,10 +476,10 @@ public class ForgottenPasswordStateMachine
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
                     throws PwmUnrecoverableException
                     throws PwmUnrecoverableException
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
                 final String userEnteredCode = formValues.get( PwmConstants.PARAM_OTP_TOKEN );
                 final String userEnteredCode = formValues.get( PwmConstants.PARAM_OTP_TOKEN );
 
 
-                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean() );
+                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean() );
                 final OTPUserRecord otpUserRecord = userInfo.getOtpUserRecord();
                 final OTPUserRecord otpUserRecord = userInfo.getOtpUserRecord();
 
 
                 ErrorInformation errorInformation = null;
                 ErrorInformation errorInformation = null;
@@ -487,11 +487,11 @@ public class ForgottenPasswordStateMachine
                 boolean otpPassed = false;
                 boolean otpPassed = false;
                 if ( otpUserRecord != null && !StringUtil.isEmpty( userEnteredCode ) )
                 if ( otpUserRecord != null && !StringUtil.isEmpty( userEnteredCode ) )
                 {
                 {
-                    LOGGER.trace( commonValues.getSessionLabel(), () -> "checking entered OTP for user " + userInfo.getUserIdentity().toDisplayString() );
+                    LOGGER.trace( pwmRequestContext.getSessionLabel(), () -> "checking entered OTP for user " + userInfo.getUserIdentity().toDisplayString() );
                     try
                     try
                     {
                     {
                         // forces service to use proxy account to update (write) updated otp record if necessary.
                         // forces service to use proxy account to update (write) updated otp record if necessary.
-                        otpPassed = commonValues.getPwmApplication().getOtpService().validateToken(
+                        otpPassed = pwmRequestContext.getPwmApplication().getOtpService().validateToken(
                                 null,
                                 null,
                                 userInfo.getUserIdentity(),
                                 userInfo.getUserIdentity(),
                                 otpUserRecord,
                                 otpUserRecord,
@@ -506,12 +506,12 @@ public class ForgottenPasswordStateMachine
                 }
                 }
 
 
                 final String passedStr = otpPassed ? "passed" : "failed";
                 final String passedStr = otpPassed ? "passed" : "failed";
-                LOGGER.trace( commonValues.getSessionLabel(), () -> "one time password validation has " + passedStr + " for user "
+                LOGGER.trace( pwmRequestContext.getSessionLabel(), () -> "one time password validation has " + passedStr + " for user "
                         + userInfo.getUserIdentity().toDisplayString() );
                         + userInfo.getUserIdentity().toDisplayString() );
 
 
                 if ( otpPassed )
                 if ( otpPassed )
                 {
                 {
-                    commonValues.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_OTP_PASSED );
+                    pwmRequestContext.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_OTP_PASSED );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.OTP );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.OTP );
                 }
                 }
                 else
                 else
@@ -519,8 +519,8 @@ public class ForgottenPasswordStateMachine
                     errorInformation = errorInformation == null
                     errorInformation = errorInformation == null
                             ? new ErrorInformation( PwmError.ERROR_INCORRECT_OTP_TOKEN )
                             ? new ErrorInformation( PwmError.ERROR_INCORRECT_OTP_TOKEN )
                             : errorInformation;
                             : errorInformation;
-                    commonValues.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_OTP_FAILED );
-                    handleUserVerificationBadAttempt( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
+                    pwmRequestContext.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_OTP_FAILED );
+                    handleUserVerificationBadAttempt( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
                     throw new PwmUnrecoverableException( errorInformation );
                     throw new PwmUnrecoverableException( errorInformation );
                 }
                 }
             }
             }
@@ -528,7 +528,7 @@ public class ForgottenPasswordStateMachine
             @Override
             @Override
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine ) throws PwmUnrecoverableException
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine ) throws PwmUnrecoverableException
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
 
 
                 final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo(
                 final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo(
                         forgottenPasswordStateMachine.getCommonValues(),
                         forgottenPasswordStateMachine.getCommonValues(),
@@ -543,11 +543,11 @@ public class ForgottenPasswordStateMachine
                 final String message;
                 final String message;
                 if ( StringUtil.isEmpty( identifier ) )
                 if ( StringUtil.isEmpty( identifier ) )
                 {
                 {
-                    message = LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverOTP, commonValues.getConfig() );
+                    message = LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverOTP, pwmRequestContext.getConfig() );
                 }
                 }
                 else
                 else
                 {
                 {
-                    message = LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverOTPIdentified, commonValues.getConfig(), new String[]
+                    message = LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverOTPIdentified, pwmRequestContext.getConfig(), new String[]
                             {
                             {
                                     identifier,
                                     identifier,
                             }
                             }
@@ -557,12 +557,12 @@ public class ForgottenPasswordStateMachine
                 final PresentableFormRow formRow = PresentableFormRow.builder()
                 final PresentableFormRow formRow = PresentableFormRow.builder()
                         .name( PwmConstants.PARAM_OTP_TOKEN )
                         .name( PwmConstants.PARAM_OTP_TOKEN )
                         .type( FormConfiguration.Type.text )
                         .type( FormConfiguration.Type.text )
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Field_Code, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Field_Code, pwmRequestContext.getConfig() ) )
                         .required( true )
                         .required( true )
                         .build();
                         .build();
 
 
                 return PresentableForm.builder()
                 return PresentableForm.builder()
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
                         .message( message )
                         .message( message )
                         .formRow( formRow )
                         .formRow( formRow )
                         .build();
                         .build();
@@ -574,7 +574,7 @@ public class ForgottenPasswordStateMachine
             @Override
             @Override
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues ) throws PwmUnrecoverableException
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues ) throws PwmUnrecoverableException
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
                 final TokenDestinationItem tokenDestinationItem = forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getTokenDestination();
                 final TokenDestinationItem tokenDestinationItem = forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getTokenDestination();
                 final String userEnteredCode = formValues.get( PwmConstants.PARAM_TOKEN );
                 final String userEnteredCode = formValues.get( PwmConstants.PARAM_TOKEN );
 
 
@@ -582,7 +582,7 @@ public class ForgottenPasswordStateMachine
                 try
                 try
                 {
                 {
                     final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
                     final TokenPayload tokenPayload = TokenUtil.checkEnteredCode(
-                            commonValues,
+                            pwmRequestContext,
                             userEnteredCode,
                             userEnteredCode,
                             tokenDestinationItem,
                             tokenDestinationItem,
                             forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity(),
                             forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity(),
@@ -596,16 +596,16 @@ public class ForgottenPasswordStateMachine
                     }
                     }
 
 
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.TOKEN );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.TOKEN );
-                    StatisticsManager.incrementStat( commonValues.getPwmApplication(), Statistic.RECOVERY_TOKENS_PASSED );
+                    StatisticsManager.incrementStat( pwmRequestContext.getPwmApplication(), Statistic.RECOVERY_TOKENS_PASSED );
 
 
-                    if ( commonValues.getConfig().readSettingAsBoolean( PwmSetting.DISPLAY_TOKEN_SUCCESS_BUTTON ) )
+                    if ( pwmRequestContext.getConfig().readSettingAsBoolean( PwmSetting.DISPLAY_TOKEN_SUCCESS_BUTTON ) )
                     {
                     {
                         return;
                         return;
                     }
                     }
                 }
                 }
                 catch ( final PwmUnrecoverableException e )
                 catch ( final PwmUnrecoverableException e )
                 {
                 {
-                    LOGGER.debug( commonValues.getSessionLabel(), () -> "error while checking entered token: " );
+                    LOGGER.debug( pwmRequestContext.getSessionLabel(), () -> "error while checking entered token: " );
                     errorInformation = e.getErrorInformation();
                     errorInformation = e.getErrorInformation();
                 }
                 }
 
 
@@ -615,7 +615,7 @@ public class ForgottenPasswordStateMachine
                     {
                     {
                         errorInformation = new ErrorInformation( PwmError.ERROR_TOKEN_INCORRECT );
                         errorInformation = new ErrorInformation( PwmError.ERROR_TOKEN_INCORRECT );
                     }
                     }
-                    handleUserVerificationBadAttempt( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
+                    handleUserVerificationBadAttempt( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
                 }
                 }
 
 
                 if ( errorInformation != null )
                 if ( errorInformation != null )
@@ -627,14 +627,18 @@ public class ForgottenPasswordStateMachine
             @Override
             @Override
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
-                final boolean valueMasking = commonValues.getConfig().readSettingAsBoolean( PwmSetting.TOKEN_ENABLE_VALUE_MASKING );
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
+                final boolean valueMasking = pwmRequestContext.getConfig().readSettingAsBoolean( PwmSetting.TOKEN_ENABLE_VALUE_MASKING );
                 final FormConfiguration.Type formType = valueMasking
                 final FormConfiguration.Type formType = valueMasking
                         ? FormConfiguration.Type.password
                         ? FormConfiguration.Type.password
                         : FormConfiguration.Type.text;
                         : FormConfiguration.Type.text;
 
 
                 final String tokenDisplay = forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getTokenDestination().getDisplay();
                 final String tokenDisplay = forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getTokenDestination().getDisplay();
-                final String message = LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverEnterCode, commonValues.getConfig(), new String[]
+                final String message = LocaleHelper.getLocalizedMessage(
+                        pwmRequestContext.getLocale(),
+                        Display.Display_RecoverEnterCode,
+                        pwmRequestContext.getConfig(),
+                        new String[]
                         {
                         {
                                 tokenDisplay,
                                 tokenDisplay,
                         }
                         }
@@ -643,12 +647,12 @@ public class ForgottenPasswordStateMachine
                 final PresentableFormRow formRow = PresentableFormRow.builder()
                 final PresentableFormRow formRow = PresentableFormRow.builder()
                         .name( PwmConstants.PARAM_TOKEN )
                         .name( PwmConstants.PARAM_TOKEN )
                         .type( formType )
                         .type( formType )
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Field_VerificationMethodToken, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Field_VerificationMethodToken, pwmRequestContext.getConfig() ) )
                         .required( true )
                         .required( true )
                         .build();
                         .build();
 
 
                 return PresentableForm.builder()
                 return PresentableForm.builder()
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
                         .message( message )
                         .message( message )
                         .formRow( formRow )
                         .formRow( formRow )
                         .build();
                         .build();
@@ -662,8 +666,8 @@ public class ForgottenPasswordStateMachine
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
             public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
                     throws PwmUnrecoverableException
                     throws PwmUnrecoverableException
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
-                final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean() );
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
+                final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean() );
                 if ( responseSet == null )
                 if ( responseSet == null )
                 {
                 {
                     final String errorMsg = "attempt to check responses, but responses are not loaded into session bean";
                     final String errorMsg = "attempt to check responses, but responses are not loaded into session bean";
@@ -690,14 +694,14 @@ public class ForgottenPasswordStateMachine
                 if ( responsesPassed )
                 if ( responsesPassed )
                 {
                 {
                     final UserIdentity userIdentity = forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity();
                     final UserIdentity userIdentity = forgottenPasswordStateMachine.getForgottenPasswordBean().getUserIdentity();
-                    LOGGER.debug( commonValues.getSessionLabel(), () -> "user '" + userIdentity + "' has supplied correct responses" );
+                    LOGGER.debug( pwmRequestContext.getSessionLabel(), () -> "user '" + userIdentity + "' has supplied correct responses" );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.CHALLENGE_RESPONSES );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProgress().getSatisfiedMethods().add( IdentityVerificationMethod.CHALLENGE_RESPONSES );
                 }
                 }
                 else
                 else
                 {
                 {
                     final String errorMsg = "incorrect response to one or more challenges";
                     final String errorMsg = "incorrect response to one or more challenges";
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INCORRECT_RESPONSE, errorMsg );
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_INCORRECT_RESPONSE, errorMsg );
-                    handleUserVerificationBadAttempt( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
+                    handleUserVerificationBadAttempt( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean(), errorInformation );
                     throw new PwmUnrecoverableException( errorInformation );
                     throw new PwmUnrecoverableException( errorInformation );
                 }
                 }
             }
             }
@@ -705,7 +709,7 @@ public class ForgottenPasswordStateMachine
             @Override
             @Override
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
                 final ChallengeSetBean challengeSetBean = forgottenPasswordStateMachine.getForgottenPasswordBean().getPresentableChallengeSet();
                 final ChallengeSetBean challengeSetBean = forgottenPasswordStateMachine.getForgottenPasswordBean().getPresentableChallengeSet();
                 final List<PresentableFormRow> formRows = new ArrayList<>();
                 final List<PresentableFormRow> formRows = new ArrayList<>();
 
 
@@ -722,8 +726,8 @@ public class ForgottenPasswordStateMachine
                     );
                     );
                 }
                 }
                 return PresentableForm.builder()
                 return PresentableForm.builder()
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
-                        .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverPassword, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                        .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverPassword, pwmRequestContext.getConfig() ) )
                         .formRows( formRows )
                         .formRows( formRows )
                         .build();
                         .build();
             }
             }
@@ -834,11 +838,11 @@ public class ForgottenPasswordStateMachine
             @Override
             @Override
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
             {
             {
-                final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+                final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
                 final List<FormConfiguration> formConfigurations = forgottenPasswordStateMachine.getForgottenPasswordBean().getAttributeForm();
                 final List<FormConfiguration> formConfigurations = forgottenPasswordStateMachine.getForgottenPasswordBean().getAttributeForm();
                 return PresentableForm.builder()
                 return PresentableForm.builder()
-                        .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
-                        .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverPassword, commonValues.getConfig() ) )
+                        .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                        .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverPassword, pwmRequestContext.getConfig() ) )
                         .formRows( PresentableFormRow.fromFormConfigurations( formConfigurations, forgottenPasswordStateMachine.getCommonValues().getLocale() ) )
                         .formRows( PresentableFormRow.fromFormConfigurations( formConfigurations, forgottenPasswordStateMachine.getCommonValues().getLocale() ) )
                         .build();
                         .build();
             }
             }
@@ -853,10 +857,10 @@ public class ForgottenPasswordStateMachine
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> formValues )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordStateMachine.getForgottenPasswordBean();
             final ForgottenPasswordBean forgottenPasswordBean = forgottenPasswordStateMachine.getForgottenPasswordBean();
             final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
             final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
-                    ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( commonValues, forgottenPasswordBean )
+                    ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( pwmRequestContext, forgottenPasswordBean )
             );
             );
 
 
             final IdentityVerificationMethod requestedChoice = JavaHelper.readEnumFromString(
             final IdentityVerificationMethod requestedChoice = JavaHelper.readEnumFromString(
@@ -879,9 +883,9 @@ public class ForgottenPasswordStateMachine
         @Override
         @Override
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
             final LinkedHashSet<IdentityVerificationMethod> remainingAvailableOptionalMethods = new LinkedHashSet<>(
-                    ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean() )
+                    ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean() )
             );
             );
 
 
             final Map<String, String> selectOptions = new LinkedHashMap<>();
             final Map<String, String> selectOptions = new LinkedHashMap<>();
@@ -889,22 +893,26 @@ public class ForgottenPasswordStateMachine
             {
             {
                 if ( method.isUserSelectable() )
                 if ( method.isUserSelectable() )
                 {
                 {
-                    selectOptions.put( method.name(), method.getLabel( commonValues.getConfig(), commonValues.getLocale() ) );
+                    selectOptions.put( method.name(), method.getLabel( pwmRequestContext.getConfig(), pwmRequestContext.getLocale() ) );
                 }
                 }
             }
             }
 
 
+            final Map<String, String> locales = Collections.singletonMap(
+                    "",
+                    LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Button_Select, pwmRequestContext.getConfig() ) );
+
             final FormConfiguration formConfiguration = FormConfiguration.builder()
             final FormConfiguration formConfiguration = FormConfiguration.builder()
                     .type( FormConfiguration.Type.select )
                     .type( FormConfiguration.Type.select )
                     .required( true )
                     .required( true )
                     .selectOptions( selectOptions )
                     .selectOptions( selectOptions )
-                    .labels( Collections.singletonMap( "", LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Button_Select, commonValues.getConfig() ) ) )
+                    .labels( locales )
                     .name( PwmConstants.PARAM_METHOD_CHOICE )
                     .name( PwmConstants.PARAM_METHOD_CHOICE )
                     .build();
                     .build();
 
 
             return PresentableForm.builder()
             return PresentableForm.builder()
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
-                    .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_RecoverVerificationChoice, commonValues.getConfig() ) )
-                    .formRow( PresentableFormRow.fromFormConfiguration( formConfiguration, commonValues.getLocale() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                    .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_RecoverVerificationChoice, pwmRequestContext.getConfig() ) )
+                    .formRow( PresentableFormRow.fromFormConfiguration( formConfiguration, pwmRequestContext.getLocale() ) )
                     .build();
                     .build();
         }
         }
     }
     }
@@ -915,15 +923,15 @@ public class ForgottenPasswordStateMachine
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
         public PresentableForm generateForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
             final String profile = forgottenPasswordStateMachine.getForgottenPasswordBean().getProfile();
             final String profile = forgottenPasswordStateMachine.getForgottenPasswordBean().getProfile();
-            final List<FormConfiguration> formFields = new ArrayList<>( makeSelectableContextValues( commonValues, profile ) );
-            formFields.addAll( commonValues.getConfig().readSettingAsForm( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FORM ) );
+            final List<FormConfiguration> formFields = new ArrayList<>( makeSelectableContextValues( pwmRequestContext, profile ) );
+            formFields.addAll( pwmRequestContext.getConfig().readSettingAsForm( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FORM ) );
 
 
             return PresentableForm.builder()
             return PresentableForm.builder()
-                    .label( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Title_ForgottenPassword, commonValues.getConfig() ) )
-                    .message( LocaleHelper.getLocalizedMessage( commonValues.getLocale(), Display.Display_ForgottenPassword, commonValues.getConfig() ) )
-                    .formRows( PresentableFormRow.fromFormConfigurations( formFields, commonValues.getLocale() ) )
+                    .label( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Title_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                    .message( LocaleHelper.getLocalizedMessage( pwmRequestContext.getLocale(), Display.Display_ForgottenPassword, pwmRequestContext.getConfig() ) )
+                    .formRows( PresentableFormRow.fromFormConfigurations( formFields, pwmRequestContext.getLocale() ) )
                     .build();
                     .build();
         }
         }
 
 
@@ -931,7 +939,7 @@ public class ForgottenPasswordStateMachine
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> values )
         public void applyForm( final ForgottenPasswordStateMachine forgottenPasswordStateMachine, final Map<String, String> values )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final CommonValues commonValues = forgottenPasswordStateMachine.getCommonValues();
+            final PwmRequestContext pwmRequestContext = forgottenPasswordStateMachine.getCommonValues();
 
 
             if ( forgottenPasswordStateMachine.nextStage() != ForgottenPasswordStage.IDENTIFICATION )
             if ( forgottenPasswordStateMachine.nextStage() != ForgottenPasswordStage.IDENTIFICATION )
             {
             {
@@ -946,42 +954,42 @@ public class ForgottenPasswordStateMachine
             // process input profile
             // process input profile
             {
             {
                 final String inputProfile = values.get( PwmConstants.PARAM_LDAP_PROFILE );
                 final String inputProfile = values.get( PwmConstants.PARAM_LDAP_PROFILE );
-                if ( !StringUtil.isEmpty( inputProfile ) && commonValues.getConfig().getLdapProfiles().containsKey( inputProfile ) )
+                if ( !StringUtil.isEmpty( inputProfile ) && pwmRequestContext.getConfig().getLdapProfiles().containsKey( inputProfile ) )
                 {
                 {
                     forgottenPasswordStateMachine.getForgottenPasswordBean().setProfile( inputProfile );
                     forgottenPasswordStateMachine.getForgottenPasswordBean().setProfile( inputProfile );
                 }
                 }
             }
             }
 
 
-            final LdapProfile ldapProfile = commonValues.getConfig().getLdapProfiles().getOrDefault(
+            final LdapProfile ldapProfile = pwmRequestContext.getConfig().getLdapProfiles().getOrDefault(
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProfile(),
                     forgottenPasswordStateMachine.getForgottenPasswordBean().getProfile(),
-                    commonValues.getConfig().getDefaultLdapProfile() );
+                    pwmRequestContext.getConfig().getDefaultLdapProfile() );
 
 
             final String contextParam = values.get( PwmConstants.PARAM_CONTEXT );
             final String contextParam = values.get( PwmConstants.PARAM_CONTEXT );
 
 
-            final List<FormConfiguration> forgottenPasswordForm = commonValues.getConfig().readSettingAsForm( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FORM );
+            final List<FormConfiguration> forgottenPasswordForm = pwmRequestContext.getConfig().readSettingAsForm( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FORM );
 
 
-            final boolean bogusUserModeEnabled = commonValues.getConfig().readSettingAsBoolean( PwmSetting.RECOVERY_BOGUS_USER_ENABLE );
+            final boolean bogusUserModeEnabled = pwmRequestContext.getConfig().readSettingAsBoolean( PwmSetting.RECOVERY_BOGUS_USER_ENABLE );
 
 
             Map<FormConfiguration, String> formValues = new LinkedHashMap<>();
             Map<FormConfiguration, String> formValues = new LinkedHashMap<>();
 
 
             try
             try
             {
             {
                 //read the values from the request
                 //read the values from the request
-                formValues = FormUtility.readFormValuesFromMap( values, forgottenPasswordForm, commonValues.getLocale() );
+                formValues = FormUtility.readFormValuesFromMap( values, forgottenPasswordForm, pwmRequestContext.getLocale() );
 
 
                 // check for intruder search values
                 // check for intruder search values
-                commonValues.getPwmApplication().getIntruderManager().convenience().checkAttributes( formValues );
+                pwmRequestContext.getPwmApplication().getIntruderManager().convenience().checkAttributes( formValues );
 
 
                 // see if the values meet the configured form requirements.
                 // see if the values meet the configured form requirements.
-                FormUtility.validateFormValues( commonValues.getConfig(), formValues, commonValues.getLocale() );
+                FormUtility.validateFormValues( pwmRequestContext.getConfig(), formValues, pwmRequestContext.getLocale() );
 
 
                 final String searchFilter;
                 final String searchFilter;
                 {
                 {
-                    final String configuredSearchFilter = commonValues.getConfig().readSettingAsString( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FILTER );
+                    final String configuredSearchFilter = pwmRequestContext.getConfig().readSettingAsString( PwmSetting.FORGOTTEN_PASSWORD_SEARCH_FILTER );
                     if ( configuredSearchFilter == null || configuredSearchFilter.isEmpty() )
                     if ( configuredSearchFilter == null || configuredSearchFilter.isEmpty() )
                     {
                     {
-                        searchFilter = FormUtility.ldapSearchFilterForForm( commonValues.getPwmApplication(), forgottenPasswordForm );
-                        LOGGER.trace( commonValues.getSessionLabel(), () -> "auto generated ldap search filter: " + searchFilter );
+                        searchFilter = FormUtility.ldapSearchFilterForForm( pwmRequestContext.getPwmApplication(), forgottenPasswordForm );
+                        LOGGER.trace( pwmRequestContext.getSessionLabel(), () -> "auto generated ldap search filter: " + searchFilter );
                     }
                     }
                     else
                     else
                     {
                     {
@@ -992,7 +1000,7 @@ public class ForgottenPasswordStateMachine
 
 
                 // convert the username field to an identity
                 // convert the username field to an identity
                 {
                 {
-                    final UserSearchEngine userSearchEngine = commonValues.getPwmApplication().getUserSearchEngine();
+                    final UserSearchEngine userSearchEngine = pwmRequestContext.getPwmApplication().getUserSearchEngine();
                     final SearchConfiguration searchConfiguration = SearchConfiguration.builder()
                     final SearchConfiguration searchConfiguration = SearchConfiguration.builder()
                             .filter( searchFilter )
                             .filter( searchFilter )
                             .formValues( formValues )
                             .formValues( formValues )
@@ -1000,7 +1008,7 @@ public class ForgottenPasswordStateMachine
                             .ldapProfile( ldapProfile.getIdentifier() )
                             .ldapProfile( ldapProfile.getIdentifier() )
                             .build();
                             .build();
 
 
-                    userIdentity = userSearchEngine.performSingleUserSearch( searchConfiguration, commonValues.getSessionLabel() );
+                    userIdentity = userSearchEngine.performSingleUserSearch( searchConfiguration, pwmRequestContext.getSessionLabel() );
                 }
                 }
 
 
                 if ( userIdentity == null )
                 if ( userIdentity == null )
@@ -1008,12 +1016,12 @@ public class ForgottenPasswordStateMachine
                     throw new PwmOperationalException( new ErrorInformation( PwmError.ERROR_CANT_MATCH_USER ) );
                     throw new PwmOperationalException( new ErrorInformation( PwmError.ERROR_CANT_MATCH_USER ) );
                 }
                 }
 
 
-                AuthenticationUtility.checkIfUserEligibleToAuthentication( commonValues.getPwmApplication(), userIdentity );
+                AuthenticationUtility.checkIfUserEligibleToAuthentication( pwmRequestContext.getPwmApplication(), userIdentity );
 
 
-                ForgottenPasswordUtil.initForgottenPasswordBean( commonValues, userIdentity, forgottenPasswordStateMachine.getForgottenPasswordBean() );
+                ForgottenPasswordUtil.initForgottenPasswordBean( pwmRequestContext, userIdentity, forgottenPasswordStateMachine.getForgottenPasswordBean() );
 
 
                 // clear intruder search values
                 // clear intruder search values
-                commonValues.getPwmApplication().getIntruderManager().convenience().clearAttributes( formValues );
+                pwmRequestContext.getPwmApplication().getIntruderManager().convenience().clearAttributes( formValues );
 
 
                 return;
                 return;
             }
             }
@@ -1025,25 +1033,25 @@ public class ForgottenPasswordStateMachine
                             PwmError.ERROR_RESPONSES_NORESPONSES,
                             PwmError.ERROR_RESPONSES_NORESPONSES,
                             e.getErrorInformation().getDetailedErrorMsg(), e.getErrorInformation().getFieldValues()
                             e.getErrorInformation().getDetailedErrorMsg(), e.getErrorInformation().getFieldValues()
                     );
                     );
-                    commonValues.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_FAILURES );
+                    pwmRequestContext.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_FAILURES );
 
 
-                    commonValues.getPwmApplication().getIntruderManager().convenience().markAttributes( formValues, commonValues.getSessionLabel() );
+                    pwmRequestContext.getPwmApplication().getIntruderManager().convenience().markAttributes( formValues, pwmRequestContext.getSessionLabel() );
 
 
-                    LOGGER.debug( commonValues.getSessionLabel(), errorInfo );
+                    LOGGER.debug( pwmRequestContext.getSessionLabel(), errorInfo );
                     forgottenPasswordStateMachine.clear();
                     forgottenPasswordStateMachine.clear();
                     throw new PwmUnrecoverableException( errorInfo );
                     throw new PwmUnrecoverableException( errorInfo );
                 }
                 }
             }
             }
 
 
             // only reachable if user not matched and bogus mode is enabled
             // only reachable if user not matched and bogus mode is enabled
-            ForgottenPasswordUtil.initBogusForgottenPasswordBean( commonValues, forgottenPasswordStateMachine.getForgottenPasswordBean() );
+            ForgottenPasswordUtil.initBogusForgottenPasswordBean( pwmRequestContext, forgottenPasswordStateMachine.getForgottenPasswordBean() );
             forgottenPasswordStateMachine.getForgottenPasswordBean().setUserSearchValues( FormUtility.asStringMap( formValues ) );
             forgottenPasswordStateMachine.getForgottenPasswordBean().setUserSearchValues( FormUtility.asStringMap( formValues ) );
         }
         }
 
 
-        private List<FormConfiguration> makeSelectableContextValues( final CommonValues commonValues, final String profile )
+        private List<FormConfiguration> makeSelectableContextValues( final PwmRequestContext pwmRequestContext, final String profile )
                 throws PwmUnrecoverableException
                 throws PwmUnrecoverableException
         {
         {
-            final SelectableContextMode selectableContextMode = commonValues.getConfig().readSettingAsEnum(
+            final SelectableContextMode selectableContextMode = pwmRequestContext.getConfig().readSettingAsEnum(
                     PwmSetting.LDAP_SELECTABLE_CONTEXT_MODE,
                     PwmSetting.LDAP_SELECTABLE_CONTEXT_MODE,
                     SelectableContextMode.class );
                     SelectableContextMode.class );
 
 
@@ -1054,15 +1062,15 @@ public class ForgottenPasswordStateMachine
 
 
             final List<FormConfiguration> returnList = new ArrayList<>();
             final List<FormConfiguration> returnList = new ArrayList<>();
 
 
-            if ( selectableContextMode == SelectableContextMode.SHOW_PROFILE && commonValues.getConfig().getLdapProfiles().size() > 1 )
+            if ( selectableContextMode == SelectableContextMode.SHOW_PROFILE && pwmRequestContext.getConfig().getLdapProfiles().size() > 1 )
             {
             {
                 final Map<String, String> profileSelectValues = new LinkedHashMap<>();
                 final Map<String, String> profileSelectValues = new LinkedHashMap<>();
-                for ( final LdapProfile ldapProfile : commonValues.getConfig().getLdapProfiles().values() )
+                for ( final LdapProfile ldapProfile : pwmRequestContext.getConfig().getLdapProfiles().values() )
                 {
                 {
-                    profileSelectValues.put( ldapProfile.getIdentifier(), ldapProfile.getDisplayName( commonValues.getLocale() ) );
+                    profileSelectValues.put( ldapProfile.getIdentifier(), ldapProfile.getDisplayName( pwmRequestContext.getLocale() ) );
                 }
                 }
                 final Map<String, String> labelLocaleMap = LocaleHelper.localeMapToStringMap(
                 final Map<String, String> labelLocaleMap = LocaleHelper.localeMapToStringMap(
-                        LocaleHelper.getUniqueLocalizations( commonValues.getConfig(), Display.class, "Field_Profile", commonValues.getLocale() ) );
+                        LocaleHelper.getUniqueLocalizations( pwmRequestContext.getConfig(), Display.class, "Field_Profile", pwmRequestContext.getLocale() ) );
                 final FormConfiguration formConfiguration = FormConfiguration.builder()
                 final FormConfiguration formConfiguration = FormConfiguration.builder()
                         .name( PwmConstants.PARAM_LDAP_PROFILE )
                         .name( PwmConstants.PARAM_LDAP_PROFILE )
                         .labels( labelLocaleMap )
                         .labels( labelLocaleMap )
@@ -1073,12 +1081,12 @@ public class ForgottenPasswordStateMachine
                 returnList.add( formConfiguration );
                 returnList.add( formConfiguration );
             }
             }
 
 
-            final LdapProfile selectedProfile = commonValues.getConfig().getLdapProfiles().getOrDefault( profile, commonValues.getConfig().getDefaultLdapProfile() );
-            final Map<String, String> selectableContexts = selectedProfile.getSelectableContexts( commonValues.getPwmApplication() );
+            final LdapProfile selectedProfile = pwmRequestContext.getConfig().getLdapProfiles().getOrDefault( profile, pwmRequestContext.getConfig().getDefaultLdapProfile() );
+            final Map<String, String> selectableContexts = selectedProfile.getSelectableContexts( pwmRequestContext.getPwmApplication() );
             if ( selectableContexts != null && selectableContexts.size() > 1 )
             if ( selectableContexts != null && selectableContexts.size() > 1 )
             {
             {
                 final Map<String, String> labelLocaleMap = LocaleHelper.localeMapToStringMap(
                 final Map<String, String> labelLocaleMap = LocaleHelper.localeMapToStringMap(
-                        LocaleHelper.getUniqueLocalizations( commonValues.getConfig(), Display.class, "Field_Context", commonValues.getLocale() ) );
+                        LocaleHelper.getUniqueLocalizations( pwmRequestContext.getConfig(), Display.class, "Field_Context", pwmRequestContext.getLocale() ) );
                 final FormConfiguration formConfiguration = FormConfiguration.builder()
                 final FormConfiguration formConfiguration = FormConfiguration.builder()
                         .name( PwmConstants.PARAM_CONTEXT )
                         .name( PwmConstants.PARAM_CONTEXT )
                         .labels( labelLocaleMap )
                         .labels( labelLocaleMap )
@@ -1094,13 +1102,13 @@ public class ForgottenPasswordStateMachine
     }
     }
 
 
     private static void handleUserVerificationBadAttempt(
     private static void handleUserVerificationBadAttempt(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean,
             final ForgottenPasswordBean forgottenPasswordBean,
             final ErrorInformation errorInformation
             final ErrorInformation errorInformation
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        LOGGER.debug( commonValues.getSessionLabel(), errorInformation );
+        LOGGER.debug( pwmRequestContext.getSessionLabel(), errorInformation );
 
 
         final UserIdentity userIdentity = forgottenPasswordBean == null
         final UserIdentity userIdentity = forgottenPasswordBean == null
                 ? null
                 ? null
@@ -1108,18 +1116,18 @@ public class ForgottenPasswordStateMachine
 
 
 
 
         // add a bit of jitter to pretend like we're checking a data source
         // add a bit of jitter to pretend like we're checking a data source
-        final long jitterMs = 300L + commonValues.getPwmApplication().getSecureService().pwmRandom().nextInt( 700 );
+        final long jitterMs = 300L + pwmRequestContext.getPwmApplication().getSecureService().pwmRandom().nextInt( 700 );
         TimeDuration.of( jitterMs, TimeDuration.Unit.MILLISECONDS ).pause();
         TimeDuration.of( jitterMs, TimeDuration.Unit.MILLISECONDS ).pause();
 
 
         if ( userIdentity != null )
         if ( userIdentity != null )
         {
         {
-            SessionAuthenticator.simulateBadPassword( commonValues, userIdentity );
+            SessionAuthenticator.simulateBadPassword( pwmRequestContext, userIdentity );
 
 
 
 
-            commonValues.getPwmApplication().getIntruderManager().convenience().markUserIdentity( userIdentity,
-                    commonValues.getSessionLabel() );
+            pwmRequestContext.getPwmApplication().getIntruderManager().convenience().markUserIdentity( userIdentity,
+                    pwmRequestContext.getSessionLabel() );
         }
         }
 
 
-        StatisticsManager.incrementStat( commonValues.getPwmApplication(), Statistic.RECOVERY_FAILURES );
+        StatisticsManager.incrementStat( pwmRequestContext.getPwmApplication(), Statistic.RECOVERY_FAILURES );
     }
     }
 }
 }

+ 48 - 48
server/src/main/java/password/pwm/http/servlet/forgottenpw/ForgottenPasswordUtil.java

@@ -53,7 +53,7 @@ import password.pwm.error.PwmError;
 import password.pwm.error.PwmException;
 import password.pwm.error.PwmException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.PwmRequest;
 import password.pwm.http.PwmRequest;
 import password.pwm.http.auth.HttpAuthRecord;
 import password.pwm.http.auth.HttpAuthRecord;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordBean;
@@ -91,7 +91,7 @@ public class ForgottenPasswordUtil
     private static final PwmLogger LOGGER = PwmLogger.forClass( ForgottenPasswordUtil.class );
     private static final PwmLogger LOGGER = PwmLogger.forClass( ForgottenPasswordUtil.class );
 
 
     static Set<IdentityVerificationMethod> figureRemainingAvailableOptionalAuthMethods(
     static Set<IdentityVerificationMethod> figureRemainingAvailableOptionalAuthMethods(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
     {
     {
@@ -104,7 +104,7 @@ public class ForgottenPasswordUtil
         {
         {
             try
             try
             {
             {
-                verifyRequirementsForAuthMethod( commonValues, forgottenPasswordBean, recoveryVerificationMethods );
+                verifyRequirementsForAuthMethod( pwmRequestContext, forgottenPasswordBean, recoveryVerificationMethods );
             }
             }
             catch ( final PwmUnrecoverableException e )
             catch ( final PwmUnrecoverableException e )
             {
             {
@@ -132,7 +132,7 @@ public class ForgottenPasswordUtil
     }
     }
 
 
     static UserInfo readUserInfo(
     static UserInfo readUserInfo(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
@@ -145,15 +145,15 @@ public class ForgottenPasswordUtil
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
 
 
         return UserInfoFactory.newUserInfoUsingProxy(
         return UserInfoFactory.newUserInfoUsingProxy(
-                commonValues.getPwmApplication(),
-                commonValues.getSessionLabel(),
+                pwmRequestContext.getPwmApplication(),
+                pwmRequestContext.getSessionLabel(),
                 userIdentity,
                 userIdentity,
-                commonValues.getLocale()
+                pwmRequestContext.getLocale()
         );
         );
     }
     }
 
 
     static ResponseSet readResponseSet(
     static ResponseSet readResponseSet(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
@@ -164,7 +164,7 @@ public class ForgottenPasswordUtil
             return null;
             return null;
         }
         }
 
 
-        final PwmApplication pwmApplication = commonValues.getPwmApplication();
+        final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final ResponseSet responseSet;
         final ResponseSet responseSet;
 
 
@@ -172,7 +172,7 @@ public class ForgottenPasswordUtil
         {
         {
             final ChaiUser theUser = pwmApplication.getProxiedChaiUser( userIdentity );
             final ChaiUser theUser = pwmApplication.getProxiedChaiUser( userIdentity );
             responseSet = pwmApplication.getCrService().readUserResponseSet(
             responseSet = pwmApplication.getCrService().readUserResponseSet(
-                    commonValues.getSessionLabel(),
+                    pwmRequestContext.getSessionLabel(),
                     userIdentity,
                     userIdentity,
                     theUser
                     theUser
             );
             );
@@ -186,27 +186,27 @@ public class ForgottenPasswordUtil
     }
     }
 
 
     static void sendUnlockNoticeEmail(
     static void sendUnlockNoticeEmail(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final PwmApplication pwmApplication = commonValues.getPwmApplication();
-        final Configuration config = commonValues.getConfig();
-        final Locale locale = commonValues.getLocale();
+        final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+        final Configuration config = pwmRequestContext.getConfig();
+        final Locale locale = pwmRequestContext.getLocale();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final UserIdentity userIdentity = forgottenPasswordBean.getUserIdentity();
         final EmailItemBean configuredEmailSetting = config.readSettingAsEmail( PwmSetting.EMAIL_UNLOCK, locale );
         final EmailItemBean configuredEmailSetting = config.readSettingAsEmail( PwmSetting.EMAIL_UNLOCK, locale );
 
 
         if ( configuredEmailSetting == null )
         if ( configuredEmailSetting == null )
         {
         {
-            LOGGER.debug( commonValues.getSessionLabel(), () -> "skipping send unlock notice email for '" + userIdentity + "' no email configured" );
+            LOGGER.debug( pwmRequestContext.getSessionLabel(), () -> "skipping send unlock notice email for '" + userIdentity + "' no email configured" );
             return;
             return;
         }
         }
 
 
-        final UserInfo userInfo = readUserInfo( commonValues, forgottenPasswordBean );
+        final UserInfo userInfo = readUserInfo( pwmRequestContext, forgottenPasswordBean );
         final MacroRequest macroRequest = MacroRequest.forUser(
         final MacroRequest macroRequest = MacroRequest.forUser(
                 pwmApplication,
                 pwmApplication,
-                commonValues.getSessionLabel(),
+                pwmRequestContext.getSessionLabel(),
                 userInfo,
                 userInfo,
                 null
                 null
         );
         );
@@ -252,20 +252,20 @@ public class ForgottenPasswordUtil
     }
     }
 
 
     static List<TokenDestinationItem> figureAvailableTokenDestinations(
     static List<TokenDestinationItem> figureAvailableTokenDestinations(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
         final String profileID = forgottenPasswordBean.getForgottenPasswordProfileID();
         final String profileID = forgottenPasswordBean.getForgottenPasswordProfileID();
-        final ForgottenPasswordProfile forgottenPasswordProfile = commonValues.getConfig().getForgottenPasswordProfiles().get( profileID );
+        final ForgottenPasswordProfile forgottenPasswordProfile = pwmRequestContext.getConfig().getForgottenPasswordProfiles().get( profileID );
         final MessageSendMethod tokenSendMethod = forgottenPasswordProfile.readSettingAsEnum( PwmSetting.RECOVERY_TOKEN_SEND_METHOD, MessageSendMethod.class );
         final MessageSendMethod tokenSendMethod = forgottenPasswordProfile.readSettingAsEnum( PwmSetting.RECOVERY_TOKEN_SEND_METHOD, MessageSendMethod.class );
-        final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordBean );
+        final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordBean );
 
 
         final List<TokenDestinationItem> items = TokenUtil.figureAvailableTokenDestinations(
         final List<TokenDestinationItem> items = TokenUtil.figureAvailableTokenDestinations(
-                commonValues.getPwmApplication(),
-                commonValues.getSessionLabel(),
-                commonValues.getLocale(),
+                pwmRequestContext.getPwmApplication(),
+                pwmRequestContext.getSessionLabel(),
+                pwmRequestContext.getLocale(),
                 userInfo,
                 userInfo,
                 tokenSendMethod
                 tokenSendMethod
         );
         );
@@ -274,7 +274,7 @@ public class ForgottenPasswordUtil
     }
     }
 
 
     static void verifyRequirementsForAuthMethod(
     static void verifyRequirementsForAuthMethod(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean,
             final ForgottenPasswordBean forgottenPasswordBean,
             final IdentityVerificationMethod recoveryVerificationMethods
             final IdentityVerificationMethod recoveryVerificationMethods
     )
     )
@@ -284,7 +284,7 @@ public class ForgottenPasswordUtil
         {
         {
             case TOKEN:
             case TOKEN:
             {
             {
-                ForgottenPasswordUtil.figureAvailableTokenDestinations( commonValues, forgottenPasswordBean );
+                ForgottenPasswordUtil.figureAvailableTokenDestinations( pwmRequestContext, forgottenPasswordBean );
             }
             }
             break;
             break;
 
 
@@ -302,7 +302,7 @@ public class ForgottenPasswordUtil
 
 
             case OTP:
             case OTP:
             {
             {
-                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordBean );
+                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordBean );
                 if ( userInfo.getOtpUserRecord() == null )
                 if ( userInfo.getOtpUserRecord() == null )
                 {
                 {
                     final String errorMsg = "could not find a one time password configuration for " + userInfo.getUserIdentity();
                     final String errorMsg = "could not find a one time password configuration for " + userInfo.getUserIdentity();
@@ -314,8 +314,8 @@ public class ForgottenPasswordUtil
 
 
             case CHALLENGE_RESPONSES:
             case CHALLENGE_RESPONSES:
             {
             {
-                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( commonValues, forgottenPasswordBean );
-                final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( commonValues, forgottenPasswordBean );
+                final UserInfo userInfo = ForgottenPasswordUtil.readUserInfo( pwmRequestContext, forgottenPasswordBean );
+                final ResponseSet responseSet = ForgottenPasswordUtil.readResponseSet( pwmRequestContext, forgottenPasswordBean );
                 if ( responseSet == null )
                 if ( responseSet == null )
                 {
                 {
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_RESPONSES_NORESPONSES );
                     final ErrorInformation errorInformation = new ErrorInformation( PwmError.ERROR_RESPONSES_NORESPONSES );
@@ -395,7 +395,7 @@ public class ForgottenPasswordUtil
 
 
 
 
     static void initializeAndSendToken(
     static void initializeAndSendToken(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserInfo userInfo,
             final UserInfo userInfo,
             final TokenDestinationItem tokenDestinationItem
             final TokenDestinationItem tokenDestinationItem
 
 
@@ -403,7 +403,7 @@ public class ForgottenPasswordUtil
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
         TokenUtil.initializeAndSendToken(
         TokenUtil.initializeAndSendToken(
-                commonValues,
+                pwmRequestContext,
                 TokenUtil.TokenInitAndSendRequest.builder()
                 TokenUtil.TokenInitAndSendRequest.builder()
                         .userInfo( userInfo )
                         .userInfo( userInfo )
                         .tokenDestinationItem( tokenDestinationItem )
                         .tokenDestinationItem( tokenDestinationItem )
@@ -413,7 +413,7 @@ public class ForgottenPasswordUtil
                         .build()
                         .build()
         );
         );
 
 
-        commonValues.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_TOKENS_SENT );
+        pwmRequestContext.getPwmApplication().getStatisticsManager().incrementValue( Statistic.RECOVERY_TOKENS_SENT );
     }
     }
 
 
 
 
@@ -539,7 +539,7 @@ public class ForgottenPasswordUtil
         }
         }
     }
     }
 
 
-    static void initBogusForgottenPasswordBean( final CommonValues commonValues, final ForgottenPasswordBean forgottenPasswordBean )
+    static void initBogusForgottenPasswordBean( final PwmRequestContext pwmRequestContext, final ForgottenPasswordBean forgottenPasswordBean )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
         forgottenPasswordBean.setUserIdentity( null );
         forgottenPasswordBean.setUserIdentity( null );
@@ -547,8 +547,8 @@ public class ForgottenPasswordUtil
 
 
         final List<Challenge> challengeList = new ArrayList<>( );
         final List<Challenge> challengeList = new ArrayList<>( );
         {
         {
-            final String firstProfile = commonValues.getConfig().getChallengeProfileIDs().iterator().next();
-            final ChallengeSet challengeSet = commonValues.getConfig().getChallengeProfile( firstProfile, PwmConstants.DEFAULT_LOCALE ).getChallengeSet();
+            final String firstProfile = pwmRequestContext.getConfig().getChallengeProfileIDs().iterator().next();
+            final ChallengeSet challengeSet = pwmRequestContext.getConfig().getChallengeProfile( firstProfile, PwmConstants.DEFAULT_LOCALE ).getChallengeSet();
             challengeList.addAll( challengeSet.getRequiredChallenges() );
             challengeList.addAll( challengeSet.getRequiredChallenges() );
             for ( int i = 0; i < challengeSet.getMinRandomRequired(); i++ )
             for ( int i = 0; i < challengeSet.getMinRandomRequired(); i++ )
             {
             {
@@ -575,7 +575,7 @@ public class ForgottenPasswordUtil
         forgottenPasswordBean.setAttributeForm( formData );
         forgottenPasswordBean.setAttributeForm( formData );
         forgottenPasswordBean.setBogusUser( true );
         forgottenPasswordBean.setBogusUser( true );
         {
         {
-            final String profileID = commonValues.getConfig().getForgottenPasswordProfiles().keySet().iterator().next();
+            final String profileID = pwmRequestContext.getConfig().getForgottenPasswordProfiles().keySet().iterator().next();
             forgottenPasswordBean.setForgottenPasswordProfileID( profileID  );
             forgottenPasswordBean.setForgottenPasswordProfileID( profileID  );
         }
         }
 
 
@@ -662,24 +662,24 @@ public class ForgottenPasswordUtil
 
 
 
 
     static void initForgottenPasswordBean(
     static void initForgottenPasswordBean(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity,
             final UserIdentity userIdentity,
             final ForgottenPasswordBean forgottenPasswordBean
             final ForgottenPasswordBean forgottenPasswordBean
     )
     )
             throws PwmUnrecoverableException, PwmOperationalException
             throws PwmUnrecoverableException, PwmOperationalException
     {
     {
 
 
-        final PwmApplication pwmApplication = commonValues.getPwmApplication();
-        final Locale locale = commonValues.getLocale();
-        final SessionLabel sessionLabel = commonValues.getSessionLabel();
+        final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+        final Locale locale = pwmRequestContext.getLocale();
+        final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
 
 
         forgottenPasswordBean.setUserIdentity( userIdentity );
         forgottenPasswordBean.setUserIdentity( userIdentity );
 
 
-        final UserInfo userInfo = readUserInfo( commonValues, forgottenPasswordBean );
+        final UserInfo userInfo = readUserInfo( pwmRequestContext, forgottenPasswordBean );
 
 
         final ForgottenPasswordProfile forgottenPasswordProfile = forgottenPasswordProfile(
         final ForgottenPasswordProfile forgottenPasswordProfile = forgottenPasswordProfile(
                 pwmApplication,
                 pwmApplication,
-                commonValues.getSessionLabel(),
+                pwmRequestContext.getSessionLabel(),
                 userIdentity
                 userIdentity
         );
         );
         final String forgottenProfileID = forgottenPasswordProfile.getIdentifier();
         final String forgottenProfileID = forgottenPasswordProfile.getIdentifier();
@@ -745,7 +745,7 @@ public class ForgottenPasswordUtil
             }
             }
         }
         }
 
 
-        final List<FormConfiguration> attributeForm = figureAttributeForm( forgottenPasswordProfile, forgottenPasswordBean, commonValues, userIdentity );
+        final List<FormConfiguration> attributeForm = figureAttributeForm( forgottenPasswordProfile, forgottenPasswordBean, pwmRequestContext, userIdentity );
 
 
         forgottenPasswordBean.setUserLocale( locale );
         forgottenPasswordBean.setUserLocale( locale );
         forgottenPasswordBean.setPresentableChallengeSet( challengeSet == null ? null : challengeSet.asChallengeSetBean() );
         forgottenPasswordBean.setPresentableChallengeSet( challengeSet == null ? null : challengeSet.asChallengeSetBean() );
@@ -756,14 +756,14 @@ public class ForgottenPasswordUtil
 
 
         for ( final IdentityVerificationMethod recoveryVerificationMethods : recoveryFlags.getRequiredAuthMethods() )
         for ( final IdentityVerificationMethod recoveryVerificationMethods : recoveryFlags.getRequiredAuthMethods() )
         {
         {
-            verifyRequirementsForAuthMethod( commonValues, forgottenPasswordBean, recoveryVerificationMethods );
+            verifyRequirementsForAuthMethod( pwmRequestContext, forgottenPasswordBean, recoveryVerificationMethods );
         }
         }
     }
     }
 
 
     static List<FormConfiguration> figureAttributeForm(
     static List<FormConfiguration> figureAttributeForm(
             final ForgottenPasswordProfile forgottenPasswordProfile,
             final ForgottenPasswordProfile forgottenPasswordProfile,
             final ForgottenPasswordBean forgottenPasswordBean,
             final ForgottenPasswordBean forgottenPasswordBean,
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity
             final UserIdentity userIdentity
     )
     )
             throws PwmOperationalException, PwmUnrecoverableException
             throws PwmOperationalException, PwmUnrecoverableException
@@ -774,7 +774,7 @@ public class ForgottenPasswordUtil
             return requiredAttributesForm;
             return requiredAttributesForm;
         }
         }
 
 
-        final UserInfo userInfo = readUserInfo( commonValues, forgottenPasswordBean );
+        final UserInfo userInfo = readUserInfo( pwmRequestContext, forgottenPasswordBean );
         final List<FormConfiguration> returnList = new ArrayList<>();
         final List<FormConfiguration> returnList = new ArrayList<>();
         for ( final FormConfiguration formItem : requiredAttributesForm )
         for ( final FormConfiguration formItem : requiredAttributesForm )
         {
         {
@@ -793,7 +793,7 @@ public class ForgottenPasswordUtil
                     }
                     }
                     else
                     else
                     {
                     {
-                        LOGGER.trace( commonValues.getSessionLabel(), () -> "excluding optional required attribute(" + formItem.getName() + "), user has no value" );
+                        LOGGER.trace( pwmRequestContext.getSessionLabel(), () -> "excluding optional required attribute(" + formItem.getName() + "), user has no value" );
                     }
                     }
                 }
                 }
                 catch ( final PwmUnrecoverableException e )
                 catch ( final PwmUnrecoverableException e )
@@ -833,7 +833,7 @@ public class ForgottenPasswordUtil
     }
     }
 
 
     static boolean hasOtherMethodChoices(
     static boolean hasOtherMethodChoices(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final ForgottenPasswordBean forgottenPasswordBean,
             final ForgottenPasswordBean forgottenPasswordBean,
             final IdentityVerificationMethod thisMethod
             final IdentityVerificationMethod thisMethod
     )
     )
@@ -856,7 +856,7 @@ public class ForgottenPasswordUtil
 
 
         {
         {
             final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
             final Set<IdentityVerificationMethod> remainingAvailableOptionalMethods = ForgottenPasswordUtil.figureRemainingAvailableOptionalAuthMethods(
-                    commonValues,
+                    pwmRequestContext,
                     forgottenPasswordBean
                     forgottenPasswordBean
             );
             );
             final Set<IdentityVerificationMethod> otherOptionalMethodChoices = JavaHelper.copiedEnumSet( remainingAvailableOptionalMethods, IdentityVerificationMethod.class );
             final Set<IdentityVerificationMethod> otherOptionalMethodChoices = JavaHelper.copiedEnumSet( remainingAvailableOptionalMethods, IdentityVerificationMethod.class );

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServletUtil.java

@@ -189,7 +189,7 @@ public class HelpdeskServletUtil
                 .build();
                 .build();
 
 
         final boolean match = UserPermissionUtility.testUserPermission(
         final boolean match = UserPermissionUtility.testUserPermission(
-                pwmRequest.commonValues(),
+                pwmRequest.getPwmRequestContext(),
                 userIdentity,
                 userIdentity,
                 userPermission
                 userPermission
         );
         );

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java

@@ -485,7 +485,7 @@ public class NewUserServlet extends ControlledPwmServlet
         try
         try
         {
         {
             tokenPayload = TokenUtil.checkEnteredCode(
             tokenPayload = TokenUtil.checkEnteredCode(
-                    pwmRequest.commonValues(),
+                    pwmRequest.getPwmRequestContext(),
                     userEnteredCode,
                     userEnteredCode,
                     tokenDestinationItem,
                     tokenDestinationItem,
                     null,
                     null,

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java

@@ -771,7 +771,7 @@ class NewUserUtils
 
 
 
 
                     TokenUtil.initializeAndSendToken(
                     TokenUtil.initializeAndSendToken(
-                            pwmRequest.commonValues(),
+                            pwmRequest.getPwmRequestContext(),
                             TokenUtil.TokenInitAndSendRequest.builder()
                             TokenUtil.TokenInitAndSendRequest.builder()
                                     .userInfo(  null )
                                     .userInfo(  null )
                                     .tokenDestinationItem( tokenDestinationItem )
                                     .tokenDestinationItem( tokenDestinationItem )

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchDataReader.java

@@ -623,7 +623,7 @@ class PeopleSearchDataReader
                     .ldapProfileID( userIdentity.getLdapProfileID() )
                     .ldapProfileID( userIdentity.getLdapProfileID() )
                     .build();
                     .build();
 
 
-            return UserPermissionUtility.testUserPermission( pwmRequest.commonValues(), userIdentity, userPermission );
+            return UserPermissionUtility.testUserPermission( pwmRequest.getPwmRequestContext(), userIdentity, userPermission );
         };
         };
 
 
         final boolean result = storeDataInCache( CacheIdentifier.checkIfViewable, userIdentity.toDelimitedKey(), Boolean.class, cacheLoader );
         final boolean result = storeDataInCache( CacheIdentifier.checkIfViewable, userIdentity.toDelimitedKey(), Boolean.class, cacheLoader );

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/peoplesearch/PhotoDataReader.java

@@ -267,7 +267,7 @@ public class PhotoDataReader
 
 
         if ( !StringUtil.isEmpty( configuredUrl ) )
         if ( !StringUtil.isEmpty( configuredUrl ) )
         {
         {
-            final MacroRequest macroRequest = MacroRequest.forUser( pwmRequest.commonValues(), userIdentity );
+            final MacroRequest macroRequest = MacroRequest.forUser( pwmRequest.getPwmRequestContext(), userIdentity );
             return Optional.of( macroRequest.expandMacros( configuredUrl ) );
             return Optional.of( macroRequest.expandMacros( configuredUrl ) );
 
 
         }
         }

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileServlet.java

@@ -172,7 +172,7 @@ public class UpdateProfileServlet extends ControlledPwmServlet
         try
         try
         {
         {
             TokenUtil.checkEnteredCode(
             TokenUtil.checkEnteredCode(
-                    pwmRequest.commonValues(),
+                    pwmRequest.getPwmRequestContext(),
                     userEnteredCode,
                     userEnteredCode,
                     tokenDestinationItem,
                     tokenDestinationItem,
                     pwmRequest.getUserInfoIfLoggedIn(),
                     pwmRequest.getUserInfoIfLoggedIn(),

+ 1 - 1
server/src/main/java/password/pwm/http/servlet/updateprofile/UpdateProfileUtil.java

@@ -319,7 +319,7 @@ public class UpdateProfileUtil
                             : updateProfileProfile.getTokenDurationSMS( pwmRequest.getConfig() );
                             : updateProfileProfile.getTokenDurationSMS( pwmRequest.getConfig() );
 
 
                     TokenUtil.initializeAndSendToken(
                     TokenUtil.initializeAndSendToken(
-                            pwmRequest.commonValues(),
+                            pwmRequest.getPwmRequestContext(),
                             TokenUtil.TokenInitAndSendRequest.builder()
                             TokenUtil.TokenInitAndSendRequest.builder()
                                     .userInfo( pwmRequest.getPwmSession().getUserInfo() )
                                     .userInfo( pwmRequest.getPwmSession().getUserInfo() )
                                     .tokenDestinationItem( tokenDestinationItem )
                                     .tokenDestinationItem( tokenDestinationItem )

+ 4 - 4
server/src/main/java/password/pwm/ldap/UserInfoFactory.java

@@ -28,7 +28,7 @@ import password.pwm.bean.UserIdentity;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.util.PasswordData;
 import password.pwm.util.PasswordData;
 
 
 import java.util.Locale;
 import java.util.Locale;
@@ -74,13 +74,13 @@ public class UserInfoFactory
     }
     }
 
 
     public static UserInfo newUserInfoUsingProxy(
     public static UserInfo newUserInfoUsingProxy(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity
             final UserIdentity userIdentity
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final ChaiProvider provider = commonValues.getPwmApplication().getProxyChaiProvider( userIdentity.getLdapProfileID() );
-        return newUserInfo( commonValues.getPwmApplication(), commonValues.getSessionLabel(), commonValues.getLocale(), userIdentity, provider, null );
+        final ChaiProvider provider = pwmRequestContext.getPwmApplication().getProxyChaiProvider( userIdentity.getLdapProfileID() );
+        return newUserInfo( pwmRequestContext.getPwmApplication(), pwmRequestContext.getSessionLabel(), pwmRequestContext.getLocale(), userIdentity, provider, null );
     }
     }
 
 
     public static UserInfo newUserInfoUsingProxy(
     public static UserInfo newUserInfoUsingProxy(

+ 6 - 6
server/src/main/java/password/pwm/ldap/auth/SessionAuthenticator.java

@@ -39,7 +39,7 @@ import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.PwmRequest;
 import password.pwm.http.PwmRequest;
 import password.pwm.http.PwmSession;
 import password.pwm.http.PwmSession;
 import password.pwm.ldap.LdapOperationsHelper;
 import password.pwm.ldap.LdapOperationsHelper;
@@ -251,14 +251,14 @@ public class SessionAuthenticator
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final CommonValues commonValues = new CommonValues( pwmApplication, sessionLabel, null, null );
-        simulateBadPassword( commonValues, userIdentity );
+        final PwmRequestContext pwmRequestContext = new PwmRequestContext( pwmApplication, sessionLabel, null, null );
+        simulateBadPassword( pwmRequestContext, userIdentity );
     }
     }
 
 
-    public static void simulateBadPassword( final CommonValues commonValues, final UserIdentity userIdentity ) throws PwmUnrecoverableException
+    public static void simulateBadPassword( final PwmRequestContext pwmRequestContext, final UserIdentity userIdentity ) throws PwmUnrecoverableException
     {
     {
-        final PwmApplication pwmApplication = commonValues.getPwmApplication();
-        final SessionLabel sessionLabel = commonValues.getSessionLabel();
+        final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
+        final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
 
 
         if ( !pwmApplication.getConfig().readSettingAsBoolean( PwmSetting.SECURITY_SIMULATE_LDAP_BAD_PASSWORD ) )
         if ( !pwmApplication.getConfig().readSettingAsBoolean( PwmSetting.SECURITY_SIMULATE_LDAP_BAD_PASSWORD ) )
         {
         {

+ 4 - 4
server/src/main/java/password/pwm/ldap/permission/UserPermissionUtility.java

@@ -30,7 +30,7 @@ import password.pwm.config.value.data.UserPermission;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.ldap.search.SearchConfiguration;
 import password.pwm.ldap.search.SearchConfiguration;
 import password.pwm.ldap.search.UserSearchEngine;
 import password.pwm.ldap.search.UserSearchEngine;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.java.StringUtil;
@@ -50,15 +50,15 @@ public class UserPermissionUtility
     private static final PwmLogger LOGGER = PwmLogger.forClass( UserPermissionUtility.class );
     private static final PwmLogger LOGGER = PwmLogger.forClass( UserPermissionUtility.class );
 
 
     public static boolean testUserPermission(
     public static boolean testUserPermission(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity,
             final UserIdentity userIdentity,
             final UserPermission userPermissions
             final UserPermission userPermissions
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
         return testUserPermission(
         return testUserPermission(
-                commonValues.getPwmApplication(),
-                commonValues.getSessionLabel(),
+                pwmRequestContext.getPwmApplication(),
+                pwmRequestContext.getSessionLabel(),
                 userIdentity,
                 userIdentity,
                 Collections.singletonList( userPermissions ) );
                 Collections.singletonList( userPermissions ) );
     }
     }

+ 4 - 4
server/src/main/java/password/pwm/svc/token/TokenService.java

@@ -46,7 +46,7 @@ import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.health.HealthMessage;
 import password.pwm.health.HealthMessage;
 import password.pwm.health.HealthRecord;
 import password.pwm.health.HealthRecord;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.auth.SessionAuthenticator;
 import password.pwm.ldap.auth.SessionAuthenticator;
 import password.pwm.svc.PwmService;
 import password.pwm.svc.PwmService;
@@ -555,7 +555,7 @@ public class TokenService implements PwmService
     }
     }
 
 
     public TokenPayload processUserEnteredCode(
     public TokenPayload processUserEnteredCode(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity sessionUserIdentity,
             final UserIdentity sessionUserIdentity,
             final TokenType tokenType,
             final TokenType tokenType,
             final String userEnteredCode,
             final String userEnteredCode,
@@ -563,7 +563,7 @@ public class TokenService implements PwmService
     )
     )
             throws PwmOperationalException, PwmUnrecoverableException
             throws PwmOperationalException, PwmUnrecoverableException
     {
     {
-        final SessionLabel sessionLabel = commonValues.getSessionLabel();
+        final SessionLabel sessionLabel = pwmRequestContext.getSessionLabel();
         try
         try
         {
         {
             final TokenPayload tokenPayload = processUserEnteredCodeImpl(
             final TokenPayload tokenPayload = processUserEnteredCodeImpl(
@@ -595,7 +595,7 @@ public class TokenService implements PwmService
 
 
             if ( sessionUserIdentity != null && tokenEntryType == TokenEntryType.unauthenticated )
             if ( sessionUserIdentity != null && tokenEntryType == TokenEntryType.unauthenticated )
             {
             {
-                SessionAuthenticator.simulateBadPassword( commonValues, sessionUserIdentity );
+                SessionAuthenticator.simulateBadPassword( pwmRequestContext, sessionUserIdentity );
                 pwmApplication.getIntruderManager().convenience().markUserIdentity( sessionUserIdentity, sessionLabel );
                 pwmApplication.getIntruderManager().convenience().markUserIdentity( sessionUserIdentity, sessionLabel );
             }
             }
             pwmApplication.getStatisticsManager().incrementValue( Statistic.RECOVERY_FAILURES );
             pwmApplication.getStatisticsManager().incrementValue( Statistic.RECOVERY_FAILURES );

+ 15 - 15
server/src/main/java/password/pwm/svc/token/TokenUtil.java

@@ -34,7 +34,7 @@ import password.pwm.config.option.MessageSendMethod;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmOperationalException;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.UserInfo;
 import password.pwm.util.java.JavaHelper;
 import password.pwm.util.java.JavaHelper;
 import password.pwm.util.java.JsonUtil;
 import password.pwm.util.java.JsonUtil;
@@ -140,7 +140,7 @@ public class TokenUtil
     }
     }
 
 
     public static TokenPayload checkEnteredCode(
     public static TokenPayload checkEnteredCode(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final String userEnteredCode,
             final String userEnteredCode,
             final TokenDestinationItem tokenDestinationItem,
             final TokenDestinationItem tokenDestinationItem,
             final UserIdentity userIdentity,
             final UserIdentity userIdentity,
@@ -149,12 +149,12 @@ public class TokenUtil
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final PwmApplication pwmApplication = commonValues.getPwmApplication();
+        final PwmApplication pwmApplication = pwmRequestContext.getPwmApplication();
 
 
         try
         try
         {
         {
             final TokenPayload tokenPayload = pwmApplication.getTokenService().processUserEnteredCode(
             final TokenPayload tokenPayload = pwmApplication.getTokenService().processUserEnteredCode(
-                    commonValues,
+                    pwmRequestContext,
                     userIdentity,
                     userIdentity,
                     tokenType,
                     tokenType,
                     userEnteredCode,
                     userEnteredCode,
@@ -207,12 +207,12 @@ public class TokenUtil
     }
     }
 
 
     public static void initializeAndSendToken(
     public static void initializeAndSendToken(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final TokenInitAndSendRequest tokenInitAndSendRequest
             final TokenInitAndSendRequest tokenInitAndSendRequest
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        final Configuration config = commonValues.getConfig();
+        final Configuration config = pwmRequestContext.getConfig();
         final UserInfo userInfo = tokenInitAndSendRequest.getUserInfo();
         final UserInfo userInfo = tokenInitAndSendRequest.getUserInfo();
         final Map<String, String> tokenMapData = new LinkedHashMap<>();
         final Map<String, String> tokenMapData = new LinkedHashMap<>();
         final MacroRequest macroRequest;
         final MacroRequest macroRequest;
@@ -224,9 +224,9 @@ public class TokenUtil
             else if ( tokenInitAndSendRequest.getUserInfo() != null )
             else if ( tokenInitAndSendRequest.getUserInfo() != null )
             {
             {
                 macroRequest = MacroRequest.forUser(
                 macroRequest = MacroRequest.forUser(
-                        commonValues.getPwmApplication(),
-                        commonValues.getLocale(),
-                        commonValues.getSessionLabel(),
+                        pwmRequestContext.getPwmApplication(),
+                        pwmRequestContext.getLocale(),
+                        pwmRequestContext.getSessionLabel(),
                         userInfo.getUserIdentity(),
                         userInfo.getUserIdentity(),
                         makeTokenDestStringReplacer( tokenInitAndSendRequest.getTokenDestinationItem() ) );
                         makeTokenDestStringReplacer( tokenInitAndSendRequest.getTokenDestinationItem() ) );
             }
             }
@@ -262,14 +262,14 @@ public class TokenUtil
 
 
             try
             try
             {
             {
-                tokenPayload = commonValues.getPwmApplication().getTokenService().createTokenPayload(
+                tokenPayload = pwmRequestContext.getPwmApplication().getTokenService().createTokenPayload(
                         tokenInitAndSendRequest.getTokenType(),
                         tokenInitAndSendRequest.getTokenType(),
                         tokenLifetime,
                         tokenLifetime,
                         tokenMapData,
                         tokenMapData,
                         userInfo == null ? null : userInfo.getUserIdentity(),
                         userInfo == null ? null : userInfo.getUserIdentity(),
                         tokenInitAndSendRequest.getTokenDestinationItem()
                         tokenInitAndSendRequest.getTokenDestinationItem()
                 );
                 );
-                tokenKey = commonValues.getPwmApplication().getTokenService().generateNewToken( tokenPayload, commonValues.getSessionLabel() );
+                tokenKey = pwmRequestContext.getPwmApplication().getTokenService().generateNewToken( tokenPayload, pwmRequestContext.getSessionLabel() );
             }
             }
             catch ( final PwmOperationalException e )
             catch ( final PwmOperationalException e )
             {
             {
@@ -279,22 +279,22 @@ public class TokenUtil
 
 
         final EmailItemBean emailItemBean = tokenInitAndSendRequest.getEmailToSend() == null
         final EmailItemBean emailItemBean = tokenInitAndSendRequest.getEmailToSend() == null
                 ? null
                 ? null
-                : config.readSettingAsEmail( tokenInitAndSendRequest.getEmailToSend(), commonValues.getLocale() );
+                : config.readSettingAsEmail( tokenInitAndSendRequest.getEmailToSend(), pwmRequestContext.getLocale() );
 
 
         final String smsMessage = tokenInitAndSendRequest.getSmsToSend() == null
         final String smsMessage = tokenInitAndSendRequest.getSmsToSend() == null
                 ? null
                 ? null
-                : config.readSettingAsLocalizedString( tokenInitAndSendRequest.getSmsToSend(), commonValues.getLocale() );
+                : config.readSettingAsLocalizedString( tokenInitAndSendRequest.getSmsToSend(), pwmRequestContext.getLocale() );
 
 
         TokenService.TokenSender.sendToken(
         TokenService.TokenSender.sendToken(
                 TokenService.TokenSendInfo.builder()
                 TokenService.TokenSendInfo.builder()
-                        .pwmApplication( commonValues.getPwmApplication() )
+                        .pwmApplication( pwmRequestContext.getPwmApplication() )
                         .userInfo( userInfo )
                         .userInfo( userInfo )
                         .macroRequest( macroRequest )
                         .macroRequest( macroRequest )
                         .configuredEmailSetting( emailItemBean )
                         .configuredEmailSetting( emailItemBean )
                         .tokenDestinationItem( tokenInitAndSendRequest.getTokenDestinationItem() )
                         .tokenDestinationItem( tokenInitAndSendRequest.getTokenDestinationItem() )
                         .smsMessage( smsMessage )
                         .smsMessage( smsMessage )
                         .tokenKey( tokenKey )
                         .tokenKey( tokenKey )
-                        .sessionLabel( commonValues.getSessionLabel() )
+                        .sessionLabel( pwmRequestContext.getSessionLabel() )
                         .build()
                         .build()
         );
         );
     }
     }

+ 3 - 3
server/src/main/java/password/pwm/util/macro/MacroRequest.java

@@ -27,7 +27,7 @@ import password.pwm.bean.LoginInfoBean;
 import password.pwm.bean.SessionLabel;
 import password.pwm.bean.SessionLabel;
 import password.pwm.bean.UserIdentity;
 import password.pwm.bean.UserIdentity;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.PwmRequest;
 import password.pwm.http.PwmRequest;
 import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.UserInfoFactory;
 import password.pwm.ldap.UserInfoFactory;
@@ -51,12 +51,12 @@ public class MacroRequest
     }
     }
 
 
     public static MacroRequest forUser(
     public static MacroRequest forUser(
-            final CommonValues commonValues,
+            final PwmRequestContext pwmRequestContext,
             final UserIdentity userIdentity
             final UserIdentity userIdentity
     )
     )
             throws PwmUnrecoverableException
             throws PwmUnrecoverableException
     {
     {
-        return forUser( commonValues.getPwmApplication(), commonValues.getLocale(), commonValues.getSessionLabel(), userIdentity );
+        return forUser( pwmRequestContext.getPwmApplication(), pwmRequestContext.getLocale(), pwmRequestContext.getSessionLabel(), userIdentity );
     }
     }
 
 
     public static MacroRequest forUser(
     public static MacroRequest forUser(

+ 1 - 1
server/src/main/java/password/pwm/util/password/PasswordUtility.java

@@ -711,7 +711,7 @@ public class PasswordUtility
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
         final UserIdentity userIdentity = pwmRequest.getUserInfoIfLoggedIn();
         final UserIdentity userIdentity = pwmRequest.getUserInfoIfLoggedIn();
         final AbstractProfile activateUserProfile = ProfileUtility.profileForUser(
         final AbstractProfile activateUserProfile = ProfileUtility.profileForUser(
-                pwmRequest.commonValues(),
+                pwmRequest.getPwmRequestContext(),
                 userIdentity,
                 userIdentity,
                 profileDefinition,
                 profileDefinition,
                 AbstractProfile.class );
                 AbstractProfile.class );

+ 9 - 9
server/src/main/java/password/pwm/util/secure/BeanCryptoMachine.java

@@ -25,7 +25,7 @@ import password.pwm.AppProperty;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.util.java.JsonUtil;
 import password.pwm.util.java.JsonUtil;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.java.TimeDuration;
 import password.pwm.util.java.TimeDuration;
@@ -40,22 +40,22 @@ public class BeanCryptoMachine<T extends Serializable>
     private static final PwmLogger LOGGER = PwmLogger.forClass( BeanCryptoMachine.class );
     private static final PwmLogger LOGGER = PwmLogger.forClass( BeanCryptoMachine.class );
     private static final String DELIMITER = ".";
     private static final String DELIMITER = ".";
 
 
-    private final CommonValues commonValues;
+    private final PwmRequestContext pwmRequestContext;
     private final TimeDuration maxIdleTimeout;
     private final TimeDuration maxIdleTimeout;
 
 
     private String key;
     private String key;
 
 
-    public BeanCryptoMachine( final CommonValues commonValues, final TimeDuration maxIdleTimeout )
+    public BeanCryptoMachine( final PwmRequestContext pwmRequestContext, final TimeDuration maxIdleTimeout )
     {
     {
-        this.commonValues = commonValues;
+        this.pwmRequestContext = pwmRequestContext;
         this.maxIdleTimeout = maxIdleTimeout;
         this.maxIdleTimeout = maxIdleTimeout;
     }
     }
 
 
     private String newKey()
     private String newKey()
     {
     {
-        final int length = Integer.parseInt( commonValues.getConfig().readAppProperty( AppProperty.HTTP_COOKIE_NONCE_LENGTH ) );
+        final int length = Integer.parseInt( pwmRequestContext.getConfig().readAppProperty( AppProperty.HTTP_COOKIE_NONCE_LENGTH ) );
 
 
-        final String random = commonValues.getPwmApplication().getSecureService().pwmRandom().alphaNumericString( length );
+        final String random = pwmRequestContext.getPwmApplication().getSecureService().pwmRandom().alphaNumericString( length );
 
 
         // timestamp component for uniqueness
         // timestamp component for uniqueness
         final String prefix = Long.toString( System.currentTimeMillis(), Character.MAX_RADIX );
         final String prefix = Long.toString( System.currentTimeMillis(), Character.MAX_RADIX );
@@ -73,7 +73,7 @@ public class BeanCryptoMachine<T extends Serializable>
             return Optional.empty();
             return Optional.empty();
         }
         }
 
 
-        final SecureService secureService = commonValues.getPwmApplication().getSecureService();
+        final SecureService secureService = pwmRequestContext.getPwmApplication().getSecureService();
         final int delimiterIndex = input.indexOf( DELIMITER );
         final int delimiterIndex = input.indexOf( DELIMITER );
         final String key = input.substring( 0, delimiterIndex );
         final String key = input.substring( 0, delimiterIndex );
         final String payload = input.substring( delimiterIndex + 1 );
         final String payload = input.substring( delimiterIndex + 1 );
@@ -83,7 +83,7 @@ public class BeanCryptoMachine<T extends Serializable>
         final TimeDuration stateAge = TimeDuration.fromCurrent( wrapper.getTimestamp() );
         final TimeDuration stateAge = TimeDuration.fromCurrent( wrapper.getTimestamp() );
         if ( stateAge.isLongerThan( maxIdleTimeout ) )
         if ( stateAge.isLongerThan( maxIdleTimeout ) )
         {
         {
-            LOGGER.trace( commonValues.getSessionLabel(), () -> "state in request is " + stateAge.asCompactString() + " old" );
+            LOGGER.trace( pwmRequestContext.getSessionLabel(), () -> "state in request is " + stateAge.asCompactString() + " old" );
             return Optional.empty();
             return Optional.empty();
         }
         }
 
 
@@ -109,7 +109,7 @@ public class BeanCryptoMachine<T extends Serializable>
             this.key = newKey();
             this.key = newKey();
         }
         }
 
 
-        final SecureService secureService = commonValues.getPwmApplication().getSecureService();
+        final SecureService secureService = pwmRequestContext.getPwmApplication().getSecureService();
         final PwmSecurityKey pwmSecurityKey = secureService.appendedSecurityKey( key );
         final PwmSecurityKey pwmSecurityKey = secureService.appendedSecurityKey( key );
         final String className = bean.getClass().getName();
         final String className = bean.getClass().getName();
         final String jsonBean = JsonUtil.serialize( bean );
         final String jsonBean = JsonUtil.serialize( bean );

+ 3 - 3
server/src/main/java/password/pwm/ws/server/RestRequest.java

@@ -25,7 +25,7 @@ import password.pwm.PwmApplication;
 import password.pwm.bean.SessionLabel;
 import password.pwm.bean.SessionLabel;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.HttpContentType;
 import password.pwm.http.HttpContentType;
 import password.pwm.http.HttpHeader;
 import password.pwm.http.HttpHeader;
 import password.pwm.http.PwmHttpRequestWrapper;
 import password.pwm.http.PwmHttpRequestWrapper;
@@ -124,9 +124,9 @@ public class RestRequest extends PwmHttpRequestWrapper
         return getPwmApplication().getProxyChaiProvider( ldapProfileID );
         return getPwmApplication().getProxyChaiProvider( ldapProfileID );
     }
     }
 
 
-    public CommonValues commonValues()
+    public PwmRequestContext commonValues()
     {
     {
-        return new CommonValues( pwmApplication, this.getSessionLabel(), this.getLocale(), requestID );
+        return new PwmRequestContext( pwmApplication, this.getSessionLabel(), this.getLocale(), requestID );
     }
     }
 }
 }
 
 

+ 5 - 5
server/src/main/java/password/pwm/ws/server/rest/RestForgottenPasswordServer.java

@@ -28,7 +28,7 @@ import password.pwm.config.option.IdentityVerificationMethod;
 import password.pwm.config.option.WebServiceUsage;
 import password.pwm.config.option.WebServiceUsage;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.http.CommonValues;
+import password.pwm.http.PwmRequestContext;
 import password.pwm.http.HttpContentType;
 import password.pwm.http.HttpContentType;
 import password.pwm.http.HttpMethod;
 import password.pwm.http.HttpMethod;
 import password.pwm.http.bean.ForgottenPasswordBean;
 import password.pwm.http.bean.ForgottenPasswordBean;
@@ -105,9 +105,9 @@ public class RestForgottenPasswordServer extends RestServlet
     public RestResultBean doRestForgottenPasswordService( final RestRequest restRequest )
     public RestResultBean doRestForgottenPasswordService( final RestRequest restRequest )
             throws PwmUnrecoverableException, IOException
             throws PwmUnrecoverableException, IOException
     {
     {
-        final CommonValues commonValues = restRequest.commonValues();
+        final PwmRequestContext pwmRequestContext = restRequest.commonValues();
         final JsonInput jsonInput = restRequest.readBodyAsJsonObject( JsonInput.class );
         final JsonInput jsonInput = restRequest.readBodyAsJsonObject( JsonInput.class );
-        final BeanCryptoMachine<ForgottenPasswordBean> beanBeanCryptoMachine = new BeanCryptoMachine<>( commonValues, figureMaxIdleTimeout( commonValues ) );
+        final BeanCryptoMachine<ForgottenPasswordBean> beanBeanCryptoMachine = new BeanCryptoMachine<>( pwmRequestContext, figureMaxIdleTimeout( pwmRequestContext ) );
         final ForgottenPasswordStateMachine stateMachine;
         final ForgottenPasswordStateMachine stateMachine;
 
 
         final boolean newState;
         final boolean newState;
@@ -156,9 +156,9 @@ public class RestForgottenPasswordServer extends RestServlet
         return restResultBean;
         return restResultBean;
     }
     }
 
 
-    private TimeDuration figureMaxIdleTimeout( final CommonValues commonValues )
+    private TimeDuration figureMaxIdleTimeout( final PwmRequestContext pwmRequestContext )
     {
     {
-        final long idleSeconds = commonValues.getConfig().readSettingAsLong( PwmSetting.IDLE_TIMEOUT_SECONDS );
+        final long idleSeconds = pwmRequestContext.getConfig().readSettingAsLong( PwmSetting.IDLE_TIMEOUT_SECONDS );
         return TimeDuration.of( idleSeconds, TimeDuration.Unit.SECONDS );
         return TimeDuration.of( idleSeconds, TimeDuration.Unit.SECONDS );
     }
     }