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

pull/129/merge
Amanda Anganes 13 years ago
commit 5cf6359f7d

@ -51,6 +51,14 @@ public abstract class AbstractJwk implements Jwk{
public void setUse(String use) { public void setUse(String use) {
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){

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

@ -46,6 +46,17 @@ public class Rsa extends AbstractJwk{
setMod(object.get(MODULUS).getAsString()); setMod(object.get(MODULUS).getAsString());
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 {

@ -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) {

Loading…
Cancel
Save