Merge branch 'master' of github.com:mitreid-connect/OpenID-Connect-Java-Spring-Server
commit
5cf6359f7d
|
@ -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());
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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…
Reference in New Issue