diff --git a/openid-connect-common/src/main/java/org/mitre/jwk/model/AbstractJwk.java b/openid-connect-common/src/main/java/org/mitre/jwk/model/AbstractJwk.java index 483dbe170..851b6a08e 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwk/model/AbstractJwk.java +++ b/openid-connect-common/src/main/java/org/mitre/jwk/model/AbstractJwk.java @@ -51,6 +51,14 @@ public abstract class AbstractJwk implements Jwk{ public void setUse(String use) { this.use = use; } + + public JsonObject toJsonObject() { + JsonObject export = new JsonObject(); + export.addProperty(ALGORITHM, getAlg()); + export.addProperty(USE, getUse()); + export.addProperty(KEY_ID, getKid()); + return export; + } protected void init(JsonObject object){ if(object.get(ALGORITHM) != null){ diff --git a/openid-connect-common/src/main/java/org/mitre/jwk/model/EC.java b/openid-connect-common/src/main/java/org/mitre/jwk/model/EC.java index 254b39767..1e73acfd2 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwk/model/EC.java +++ b/openid-connect-common/src/main/java/org/mitre/jwk/model/EC.java @@ -55,6 +55,17 @@ public class EC extends AbstractJwk{ super(object); } + + + @Override + public JsonObject toJsonObject() { + JsonObject obj = super.toJsonObject(); + obj.addProperty(CURVE, getCrv()); + obj.addProperty(X, getX()); + obj.addProperty(Y, getY()); + return obj; + } + public void init(JsonObject object){ super.init(object); setCrv(object.get(CURVE).getAsString()); diff --git a/openid-connect-common/src/main/java/org/mitre/jwk/model/Rsa.java b/openid-connect-common/src/main/java/org/mitre/jwk/model/Rsa.java index 882ffd677..6194c46be 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwk/model/Rsa.java +++ b/openid-connect-common/src/main/java/org/mitre/jwk/model/Rsa.java @@ -46,6 +46,17 @@ public class Rsa extends AbstractJwk{ setMod(object.get(MODULUS).getAsString()); setExp(object.get(EXPONENT).getAsString()); } + + + + @Override + public JsonObject toJsonObject() { + JsonObject export = super.toJsonObject(); + export.addProperty(MODULUS, getMod()); + export.addProperty(EXPONENT, getExp()); + return export; + + } @Override public PublicKey getKey() throws NoSuchAlgorithmException, InvalidKeySpecException { diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java index 37b00ed53..463c6adc6 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java @@ -274,7 +274,7 @@ public class ClientDetailsEntity implements ClientDetails { @Override @Basic - public Integer getAccessTokenValiditySeconds() { + public int getAccessTokenValiditySeconds() { return accessTokenValiditySeconds; } @@ -288,7 +288,7 @@ public class ClientDetailsEntity implements ClientDetails { @Override @Basic - public Integer getRefreshTokenValiditySeconds() { + public int getRefreshTokenValiditySeconds() { return refreshTokenValiditySeconds; }