diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityAbbreviatedView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityAbbreviatedView.java index bd5a4e5f2..3c65d81fb 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityAbbreviatedView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityAbbreviatedView.java @@ -24,6 +24,7 @@ import com.google.gson.FieldAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; +import com.google.gson.LongSerializationPolicy; @Component(ResourceSetEntityAbbreviatedView.VIEWNAME) public class ResourceSetEntityAbbreviatedView extends AbstractView { @@ -55,6 +56,7 @@ public class ResourceSetEntityAbbreviatedView extends AbstractView { }) .serializeNulls() .setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ") + .setLongSerializationPolicy(LongSerializationPolicy.STRING) .create(); @Override @@ -82,7 +84,7 @@ public class ResourceSetEntityAbbreviatedView extends AbstractView { JsonObject o = new JsonObject(); - o.addProperty("_id", rs.getId()); + o.addProperty("_id", rs.getId().toString()); // set the ID to a string o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/resource/" + rs.getId()); diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityView.java index c53392a77..674835409 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/ResourceSetEntityView.java @@ -25,6 +25,7 @@ import com.google.gson.FieldAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; +import com.google.gson.LongSerializationPolicy; @Component(ResourceSetEntityView.VIEWNAME) public class ResourceSetEntityView extends AbstractView { @@ -56,6 +57,7 @@ public class ResourceSetEntityView extends AbstractView { }) .serializeNulls() .setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ") + .setLongSerializationPolicy(LongSerializationPolicy.STRING) .create(); @Override @@ -83,7 +85,7 @@ public class ResourceSetEntityView extends AbstractView { JsonObject o = new JsonObject(); - o.addProperty("_id", rs.getId()); + o.addProperty("_id", rs.getId().toString()); // send the id as a string o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/resource/" + rs.getId()); o.addProperty("name", rs.getName()); o.addProperty("uri", rs.getUri());