Browse Source

updated to nimbus 2.13

pull/306/merge
Justin Richer 12 years ago
parent
commit
5f7c46aecd
  1. 17
      openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JWKSetSigningAndValidationServiceCacheService.java
  2. 16
      openid-connect-common/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java
  3. 2
      pom.xml

17
openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JWKSetSigningAndValidationServiceCacheService.java

@ -11,7 +11,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.mitre.jwt.signer.service.JwtSigningAndValidationService;
@ -22,14 +21,12 @@ import org.springframework.web.client.RestTemplate;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.collect.ImmutableMap;
import com.nimbusds.jose.JWK;
import com.nimbusds.jose.JWKSet;
import com.nimbusds.jose.JWSSigner;
import com.nimbusds.jose.JWSVerifier;
import com.nimbusds.jose.KeyType;
import com.nimbusds.jose.RSAKey;
import com.nimbusds.jose.crypto.RSASSAVerifier;
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.KeyType;
import com.nimbusds.jose.jwk.RSAKey;
/**
*
@ -46,7 +43,7 @@ public class JWKSetSigningAndValidationServiceCacheService {
public JWKSetSigningAndValidationServiceCacheService() {
this.cache = CacheBuilder.newBuilder()
.maximumSize(100)
.build(new JWKSetFetcher());
.build(new JWKSetVerifierFetcher());
}
/**
@ -69,7 +66,7 @@ public class JWKSetSigningAndValidationServiceCacheService {
* @author jricher
*
*/
private class JWKSetFetcher extends CacheLoader<String, JwtSigningAndValidationService> {
private class JWKSetVerifierFetcher extends CacheLoader<String, JwtSigningAndValidationService> {
private HttpClient httpClient = new DefaultHttpClient();
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
private RestTemplate restTemplate = new RestTemplate(httpFactory);
@ -93,7 +90,7 @@ public class JWKSetSigningAndValidationServiceCacheService {
byte[] modulusByte = rsa.getModulus().decode();
BigInteger modulus = new BigInteger(1, modulusByte);
byte[] exponentByte = rsa.getExponent().decode();
byte[] exponentByte = rsa.getPublicExponent().decode();
BigInteger exponent = new BigInteger(1, exponentByte);
RSAPublicKeySpec spec = new RSAPublicKeySpec(modulus, exponent);

16
openid-connect-common/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java

@ -30,24 +30,16 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.web.servlet.view.AbstractView;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.nimbusds.jose.JWK;
import com.nimbusds.jose.JWKSet;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.RSAKey;
import com.nimbusds.jose.Use;
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.jwk.RSAKey;
import com.nimbusds.jose.jwk.Use;
import com.nimbusds.jose.util.Base64URL;
/**

2
pom.xml

@ -303,7 +303,7 @@
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>2.11.0</version>
<version>2.13.0</version>
</dependency>
</dependencies>
<repositories>

Loading…
Cancel
Save