KEYCLOAK-2299
createdDate of credential is not exported
This commit is contained in:
parent
c68a78bd31
commit
26897ea46d
3 changed files with 11 additions and 0 deletions
|
@ -27,6 +27,7 @@ public class CredentialRepresentation {
|
||||||
private String algorithm;
|
private String algorithm;
|
||||||
private Integer digits;
|
private Integer digits;
|
||||||
private Integer period;
|
private Integer period;
|
||||||
|
private Long createdDate;
|
||||||
|
|
||||||
// only used when updating a credential. Might set required action
|
// only used when updating a credential. Might set required action
|
||||||
protected Boolean temporary;
|
protected Boolean temporary;
|
||||||
|
@ -118,4 +119,12 @@ public class CredentialRepresentation {
|
||||||
public void setPeriod(Integer period) {
|
public void setPeriod(Integer period) {
|
||||||
this.period = period;
|
this.period = period;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getCreatedDate() {
|
||||||
|
return createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDate(Long createdDate) {
|
||||||
|
this.createdDate = createdDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1271,6 +1271,7 @@ public class RepresentationToModel {
|
||||||
if (cred.getPeriod() == null && UserCredentialModel.TOTP.equals(cred.getType())) {
|
if (cred.getPeriod() == null && UserCredentialModel.TOTP.equals(cred.getType())) {
|
||||||
hashedCred.setPeriod(30);
|
hashedCred.setPeriod(30);
|
||||||
}
|
}
|
||||||
|
hashedCred.setCreatedDate(cred.getCreatedDate());
|
||||||
user.updateCredentialDirectly(hashedCred);
|
user.updateCredentialDirectly(hashedCred);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,6 +307,7 @@ public class ExportUtils {
|
||||||
credRep.setCounter(userCred.getCounter());
|
credRep.setCounter(userCred.getCounter());
|
||||||
credRep.setAlgorithm(userCred.getAlgorithm());
|
credRep.setAlgorithm(userCred.getAlgorithm());
|
||||||
credRep.setDigits(userCred.getDigits());
|
credRep.setDigits(userCred.getDigits());
|
||||||
|
credRep.setCreatedDate(userCred.getCreatedDate());
|
||||||
return credRep;
|
return credRep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue