KEYCLOAK-2299

createdDate of credential is not exported
This commit is contained in:
Stian Thorgersen 2016-02-03 09:48:58 +01:00
parent c68a78bd31
commit 26897ea46d
3 changed files with 11 additions and 0 deletions

View file

@ -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;
}
} }

View file

@ -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);
} }
} }

View file

@ -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;
} }