As suggested here I tried to use @JsonIgnoreboth @JsonProperty(from import com.fasterxml.jackson.annotation.*;) in the fields passwordand passwordSaltmy AppUser.
@Entity
@Table(name = "app_user")
public class AppUser extends AbstractTimestampEntity {
@JsonIgnore
public String getPassword() {
return password;
}
@JsonProperty
public void setPassword(String password) {
this.password = password;
}
@JsonIgnore
public String getPasswordSalt() {
return passwordSalt;
}
@JsonProperty
public void setPasswordSalt(String passwordSalt) {
this.passwordSalt = passwordSalt;
}
}
However, for some reason, two fields are always null. When I try to “register” a user, the JSON I submit is not completely de-serialized. passwordset to null:

What I want to achieve is to get the user password to save it, but at the same time make sure that the saved (encrypted) password is not serialized and sent back to the client.
What am I doing wrong here?