Merge branch 'master' of github.com:mitreid-connect/OpenID-Connect-Java-Spring-Server

pull/129/merge
Amanda Anganes 2012-07-31 12:14:19 -04:00
commit 5cf6359f7d
4 changed files with 31 additions and 1 deletions

View File

@ -52,6 +52,14 @@ public abstract class AbstractJwk implements Jwk{
this.use = 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){ protected void init(JsonObject object){
if(object.get(ALGORITHM) != null){ if(object.get(ALGORITHM) != null){
setAlg(object.get(ALGORITHM).getAsString()); setAlg(object.get(ALGORITHM).getAsString());

View File

@ -55,6 +55,17 @@ public class EC extends AbstractJwk{
super(object); 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){ public void init(JsonObject object){
super.init(object); super.init(object);
setCrv(object.get(CURVE).getAsString()); setCrv(object.get(CURVE).getAsString());

View File

@ -47,6 +47,17 @@ public class Rsa extends AbstractJwk{
setExp(object.get(EXPONENT).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 @Override
public PublicKey getKey() throws NoSuchAlgorithmException, InvalidKeySpecException { public PublicKey getKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
byte[] modulusByte = Base64.decodeBase64(mod); byte[] modulusByte = Base64.decodeBase64(mod);

View File

@ -56,7 +56,7 @@ public class SimpleWebDiscoveryEndpoint {
return modelAndView; return modelAndView;
} }
@RequestMapping(value="/.well-known/host-meta", @RequestMapping(value={"/.well-known/host-meta", "/.well-known/host-meta.json"},
params={"resource", "rel=http://openid.net/specs/connect/1.0/issuer"}) params={"resource", "rel=http://openid.net/specs/connect/1.0/issuer"})
public ModelAndView xrdDiscovery(@RequestParam("resource") String resource, ModelAndView modelAndView) { public ModelAndView xrdDiscovery(@RequestParam("resource") String resource, ModelAndView modelAndView) {