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

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

View File

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

View File

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

View File

@ -56,7 +56,7 @@ public class SimpleWebDiscoveryEndpoint {
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"})
public ModelAndView xrdDiscovery(@RequestParam("resource") String resource, ModelAndView modelAndView) {