Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The user DN is sent along with form fields to web service #326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,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 ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down Expand Up @@ -529,35 +529,40 @@ static Map<String, String> figureDisplayableProfiles( final PwmRequest pwmReques

static void remoteVerifyFormData(
final PwmRequest pwmRequest,
final NewUserForm newUserForm
final NewUserForm newUserForm,
final String userDn

)
throws PwmUnrecoverableException, PwmDataValidationException
{
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
{
remoteSendFormData(
pwmRequest,
newUserForm,
userDn,
FormDataRequestBean.Mode.write
);
}

private static void remoteSendFormData(
final PwmRequest pwmRequest,
final NewUserForm newUserForm,
final String userDn,
final FormDataRequestBean.Mode mode

)
Expand All @@ -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() );
Expand Down