From 19eb45a96c23f5c7e6e67e1ae1935230bcc0c71f Mon Sep 17 00:00:00 2001 From: Marco R Date: Tue, 27 Mar 2018 11:14:02 +0200 Subject: [PATCH] The user DN is sent along with form fields to web service --- .../pwm/http/servlet/newuser/NewUserServlet.java | 2 +- .../pwm/http/servlet/newuser/NewUserUtils.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java b/server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java index 3f622c3b6..0e40f084f 100644 --- a/server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java +++ b/server/src/main/java/password/pwm/http/servlet/newuser/NewUserServlet.java @@ -420,7 +420,7 @@ static PasswordUtility.PasswordCheckInfo verifyForm( validationFlags.toArray( new FormUtility.ValidationFlag[ validationFlags.size() ] ) ); - NewUserUtils.remoteVerifyFormData( pwmRequest, newUserForm ); + NewUserUtils.remoteVerifyFormData( pwmRequest, newUserForm, null ); final UserInfo uiBean = UserInfoBean.builder() .cachedPasswordRuleAttributes( FormUtility.asStringMap( formValueData ) ) diff --git a/server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java b/server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java index b6abc67f8..2d0a48c4b 100644 --- a/server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java +++ b/server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java @@ -301,7 +301,7 @@ static void createUser( NewUserUtils.LOGGER.trace( pwmSession, "new user ldap creation process complete, now authenticating user" ); // write data to remote web service - remoteWriteFormData( pwmRequest, newUserForm ); + remoteWriteFormData( pwmRequest, newUserForm, newUserDN ); // authenticate the user to pwm final UserIdentity userIdentity = new UserIdentity( newUserDN, pwmApplication.getConfig().getDefaultLdapProfile().getIdentifier() ); @@ -529,7 +529,8 @@ static Map figureDisplayableProfiles( final PwmRequest pwmReques static void remoteVerifyFormData( final PwmRequest pwmRequest, - final NewUserForm newUserForm + final NewUserForm newUserForm, + final String userDn ) throws PwmUnrecoverableException, PwmDataValidationException @@ -537,13 +538,15 @@ static void remoteVerifyFormData( remoteSendFormData( pwmRequest, newUserForm, + userDn, FormDataRequestBean.Mode.verify ); } static void remoteWriteFormData( final PwmRequest pwmRequest, - final NewUserForm newUserForm + final NewUserForm newUserForm, + final String userDn ) throws PwmUnrecoverableException, PwmDataValidationException @@ -551,6 +554,7 @@ static void remoteWriteFormData( remoteSendFormData( pwmRequest, newUserForm, + userDn, FormDataRequestBean.Mode.write ); } @@ -558,6 +562,7 @@ static void remoteWriteFormData( private static void remoteSendFormData( final PwmRequest pwmRequest, final NewUserForm newUserForm, + final String userDn, final FormDataRequestBean.Mode mode ) @@ -583,6 +588,7 @@ private static void remoteSendFormData( .formInfo( formInfo ) .formConfigurations( newUserProfile.readSettingAsForm( PwmSetting.NEWUSER_FORM ) ) .formValues( newUserForm.getFormData() ) + .userDN( userDn ) .build(); final FormDataResponseBean formDataResponseBean = restFormDataClient.invoke( formDataRequestBean, pwmRequest.getLocale() );