Ignore g-recaptcha-response in user profile validation
Signed-off-by: alexagc <alexcanal@gmail.com>
This commit is contained in:
parent
26eaa4f83f
commit
5e00fe8b10
2 changed files with 4 additions and 0 deletions
|
@ -42,6 +42,7 @@ public class RegistrationPage implements FormAuthenticator, FormAuthenticatorFac
|
|||
public static final String FIELD_USERNAME = "username";
|
||||
public static final String FIELD_LAST_NAME = "lastName";
|
||||
public static final String FIELD_FIRST_NAME = "firstName";
|
||||
public static final String FIELD_RECAPTCHA_RESPONSE = "g-recaptcha-response";
|
||||
public static final String PROVIDER_ID = "registration-page-form";
|
||||
|
||||
@Override
|
||||
|
@ -83,6 +84,7 @@ public class RegistrationPage implements FormAuthenticator, FormAuthenticatorFac
|
|||
AuthenticationExecutionModel.Requirement.REQUIRED,
|
||||
AuthenticationExecutionModel.Requirement.DISABLED
|
||||
};
|
||||
|
||||
@Override
|
||||
public AuthenticationExecutionModel.Requirement[] getRequirementChoices() {
|
||||
return REQUIREMENT_CHOICES;
|
||||
|
|
|
@ -247,6 +247,8 @@ public class RegistrationUserCreation implements FormAction, FormActionFactory {
|
|||
private MultivaluedMap<String, String> normalizeFormParameters(MultivaluedMap<String, String> formParams) {
|
||||
MultivaluedHashMap<String, String> copy = new MultivaluedHashMap<>(formParams);
|
||||
|
||||
// Remove google recaptcha form property to avoid length errors
|
||||
copy.remove(RegistrationPage.FIELD_RECAPTCHA_RESPONSE);
|
||||
// Remove "password" and "password-confirm" to avoid leaking them in the user-profile data
|
||||
copy.remove(RegistrationPage.FIELD_PASSWORD);
|
||||
copy.remove(RegistrationPage.FIELD_PASSWORD_CONFIRM);
|
||||
|
|
Loading…
Reference in a new issue