From a63c03313596b94356ede22490c36410f5234db9 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Wed, 15 Feb 2012 11:57:27 -0500 Subject: [PATCH] updated formatting of JWK endpoint to be compliant (still could use a kid field) --- .../java/org/mitre/openid/connect/view/JwkKeyListView.java | 4 +++- .../org/mitre/openid/connect/web/JsonWebKeyEndpoint.java | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java b/server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java index ecbf2e57d..af7794a0d 100644 --- a/server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java +++ b/server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java @@ -72,7 +72,9 @@ public class JwkKeyListView extends AbstractView { String e64 = Base64.encodeBase64URLSafeString(exp.toByteArray()); JsonObject o = new JsonObject(); - + + o.addProperty("use", "sig"); + o.addProperty("alg", "RSA"); o.addProperty("mod", m64); o.addProperty("exp", e64); diff --git a/server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java b/server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java index e1a9abb0a..b5abb363a 100644 --- a/server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java +++ b/server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java @@ -3,7 +3,9 @@ package org.mitre.openid.connect.web; import java.security.PublicKey; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.mitre.jwt.signer.service.JwtSigningAndValidationService; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +26,10 @@ public class JsonWebKeyEndpoint { // TODO: check if keys are empty, return a 404 here or just an empty list? - return new ModelAndView("jwkKeyList", "entity", keys); + Map jwk = new HashMap(); + jwk.put("jwk", keys); + + return new ModelAndView("jwkKeyList", "entity", jwk); } }