automated code formatting and cleanup
parent
e1e7f7a579
commit
ebbc7209aa
|
@ -16,6 +16,8 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.oauth2.introspectingfilter;
|
||||
|
||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Date;
|
||||
|
@ -29,7 +31,6 @@ import org.mitre.oauth2.introspectingfilter.service.IntrospectionAuthorityGrante
|
|||
import org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService;
|
||||
import org.mitre.oauth2.introspectingfilter.service.impl.SimpleIntrospectionAuthorityGranter;
|
||||
import org.mitre.oauth2.model.RegisteredClient;
|
||||
import org.mitre.openid.connect.client.service.ClientConfigurationService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
@ -53,8 +54,6 @@ import com.google.gson.JsonObject;
|
|||
import com.google.gson.JsonParser;
|
||||
import com.nimbusds.jose.util.Base64;
|
||||
|
||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
||||
|
||||
/**
|
||||
* This ResourceServerTokenServices implementation introspects incoming tokens at a
|
||||
* server's introspection endpoint URL and passes an Authentication object along
|
||||
|
@ -142,14 +141,14 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
|
|||
|
||||
// find out which URL to ask
|
||||
String introspectionUrl;
|
||||
RegisteredClient client;
|
||||
try {
|
||||
introspectionUrl = introspectionConfigurationService.getIntrospectionUrl(accessToken);
|
||||
client = introspectionConfigurationService.getClientConfiguration(accessToken);
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("Unable to load introspection URL or client configuration", e);
|
||||
return false;
|
||||
}
|
||||
RegisteredClient client;
|
||||
try {
|
||||
introspectionUrl = introspectionConfigurationService.getIntrospectionUrl(accessToken);
|
||||
client = introspectionConfigurationService.getClientConfiguration(accessToken);
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("Unable to load introspection URL or client configuration", e);
|
||||
return false;
|
||||
}
|
||||
// Use the SpringFramework RestTemplate to send the request to the
|
||||
// endpoint
|
||||
String validatedToken = null;
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.springframework.security.oauth2.common.OAuth2RefreshToken;
|
|||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
|
||||
|
@ -54,7 +53,7 @@ public class OAuth2AccessTokenImpl implements OAuth2AccessToken {
|
|||
DateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||
if (token.get("exp") != null) {
|
||||
try {
|
||||
expireDate = dateFormater.parse(token.get("exp").getAsString());
|
||||
expireDate = dateFormater.parse(token.get("exp").getAsString());
|
||||
} catch (ParseException ex) {
|
||||
Logger.getLogger(IntrospectingTokenService.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
|
|
@ -62,15 +62,15 @@ public class JWTParsingIntrospectionConfigurationService implements Introspectio
|
|||
|
||||
private String getIssuer(String accessToken) {
|
||||
try {
|
||||
JWT jwt = JWTParser.parse(accessToken);
|
||||
JWT jwt = JWTParser.parse(accessToken);
|
||||
|
||||
String issuer = jwt.getJWTClaimsSet().getIssuer();
|
||||
String issuer = jwt.getJWTClaimsSet().getIssuer();
|
||||
|
||||
return issuer;
|
||||
return issuer;
|
||||
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalArgumentException("Unable to parse JWT", e);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalArgumentException("Unable to parse JWT", e);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -98,27 +98,27 @@ public class JWTParsingIntrospectionConfigurationService implements Introspectio
|
|||
/* (non-Javadoc)
|
||||
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||
@Override
|
||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||
|
||||
String issuer = getIssuer(accessToken);
|
||||
if (!Strings.isNullOrEmpty(issuer)) {
|
||||
ServerConfiguration server = serverConfigurationService.getServerConfiguration(issuer);
|
||||
if (server != null) {
|
||||
RegisteredClient client = clientConfigurationService.getClientConfiguration(server);
|
||||
if (client != null) {
|
||||
return client;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Could not find client configuration for issuer " + issuer);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Could not find server configuration for issuer " + issuer);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("No issuer claim found in JWT");
|
||||
}
|
||||
String issuer = getIssuer(accessToken);
|
||||
if (!Strings.isNullOrEmpty(issuer)) {
|
||||
ServerConfiguration server = serverConfigurationService.getServerConfiguration(issuer);
|
||||
if (server != null) {
|
||||
RegisteredClient client = clientConfigurationService.getClientConfiguration(server);
|
||||
if (client != null) {
|
||||
return client;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Could not find client configuration for issuer " + issuer);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Could not find server configuration for issuer " + issuer);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("No issuer claim found in JWT");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -74,9 +74,9 @@ public class StaticIntrospectionConfigurationService implements IntrospectionCon
|
|||
/* (non-Javadoc)
|
||||
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||
return getClientConfiguration();
|
||||
}
|
||||
@Override
|
||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||
return getClientConfiguration();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client;
|
||||
|
||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.net.URI;
|
||||
|
@ -63,8 +65,6 @@ import com.nimbusds.jose.util.Base64;
|
|||
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
|
||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.*;
|
||||
|
||||
/**
|
||||
* OpenID Connect Authentication Filter class
|
||||
*
|
||||
|
|
|
@ -19,6 +19,13 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsBoolean;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsEncryptionMethodList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJweAlgorithmList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJwsAlgorithmList;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsString;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsStringList;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
@ -40,8 +47,6 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import static org.mitre.discovery.util.JsonUtils.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Dynamically fetches OpenID Connect server configurations based on the issuer. Caches the server configurations.
|
||||
|
|
|
@ -60,8 +60,8 @@ public class PlainAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
|||
|
||||
// Optional parameters:
|
||||
for (Entry<String, String> option : options.entrySet()) {
|
||||
uriBuilder.addParameter(option.getKey(), option.getValue());
|
||||
}
|
||||
uriBuilder.addParameter(option.getKey(), option.getValue());
|
||||
}
|
||||
|
||||
return uriBuilder.build().toString();
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ public class SignedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
|||
|
||||
// Optional parameters
|
||||
for (Entry<String, String> option : options.entrySet()) {
|
||||
claims.setClaim(option.getKey(), option.getValue());
|
||||
}
|
||||
claims.setClaim(option.getKey(), option.getValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -27,11 +32,6 @@ import org.mockito.Mock;
|
|||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -27,11 +32,6 @@ import org.mockito.Mock;
|
|||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -29,9 +31,6 @@ import org.springframework.security.authentication.AuthenticationServiceExceptio
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -46,10 +50,6 @@ import com.nimbusds.jose.util.Base64URL;
|
|||
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
@ -148,8 +148,8 @@ public class TestSignedAuthRequestUrlBuilder {
|
|||
assertEquals(nonce, claims.getClaim("nonce"));
|
||||
assertEquals(state, claims.getClaim("state"));
|
||||
for (String claim : options.keySet()) {
|
||||
assertEquals(options.get(claim), claims.getClaim(claim));
|
||||
}
|
||||
assertEquals(options.get(claim), claims.getClaim(claim));
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AuthenticationServiceException.class)
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -28,12 +34,6 @@ import org.mockito.Mock;
|
|||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -26,12 +32,6 @@ import org.mitre.openid.connect.config.ServerConfiguration;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.client.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -26,10 +30,6 @@ import org.springframework.security.authentication.AuthenticationServiceExceptio
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -150,8 +150,8 @@ public class JsonUtils {
|
|||
if (strings != null) {
|
||||
List<JWSAlgorithm> algs = new ArrayList<JWSAlgorithm>();
|
||||
for (String alg : strings) {
|
||||
algs.add(JWSAlgorithm.parse(alg));
|
||||
}
|
||||
algs.add(JWSAlgorithm.parse(alg));
|
||||
}
|
||||
return algs;
|
||||
} else {
|
||||
return null;
|
||||
|
@ -166,8 +166,8 @@ public class JsonUtils {
|
|||
if (strings != null) {
|
||||
List<JWEAlgorithm> algs = new ArrayList<JWEAlgorithm>();
|
||||
for (String alg : strings) {
|
||||
algs.add(JWEAlgorithm.parse(alg));
|
||||
}
|
||||
algs.add(JWEAlgorithm.parse(alg));
|
||||
}
|
||||
return algs;
|
||||
} else {
|
||||
return null;
|
||||
|
@ -182,8 +182,8 @@ public class JsonUtils {
|
|||
if (strings != null) {
|
||||
List<EncryptionMethod> algs = new ArrayList<EncryptionMethod>();
|
||||
for (String alg : strings) {
|
||||
algs.add(EncryptionMethod.parse(alg));
|
||||
}
|
||||
algs.add(EncryptionMethod.parse(alg));
|
||||
}
|
||||
return algs;
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -58,15 +58,15 @@ public class JWKSetKeyStore {
|
|||
if (location.exists() && location.isReadable()) {
|
||||
|
||||
try {
|
||||
// read in the file from disk
|
||||
String s = CharStreams.toString(new InputStreamReader(location.getInputStream(), Charsets.UTF_8));
|
||||
// read in the file from disk
|
||||
String s = CharStreams.toString(new InputStreamReader(location.getInputStream(), Charsets.UTF_8));
|
||||
|
||||
// parse it into a jwkSet object
|
||||
jwkSet = JWKSet.parse(s);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalArgumentException("Key Set resource could not be parsed: " + location); }
|
||||
// parse it into a jwkSet object
|
||||
jwkSet = JWKSet.parse(s);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalArgumentException("Key Set resource could not be parsed: " + location); }
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
||||
|
|
|
@ -274,20 +274,20 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
|||
/* (non-Javadoc)
|
||||
* @see org.mitre.jwt.encryption.service.JwtEncryptionAndDecryptionService#getAllEncryptionEncsSupported()
|
||||
*/
|
||||
@Override
|
||||
public Collection<EncryptionMethod> getAllEncryptionEncsSupported() {
|
||||
Set<EncryptionMethod> encs = new HashSet<EncryptionMethod>();
|
||||
@Override
|
||||
public Collection<EncryptionMethod> getAllEncryptionEncsSupported() {
|
||||
Set<EncryptionMethod> encs = new HashSet<EncryptionMethod>();
|
||||
|
||||
for (JWEEncrypter encrypter : encrypters.values()) {
|
||||
encs.addAll(encrypter.supportedEncryptionMethods());
|
||||
}
|
||||
for (JWEEncrypter encrypter : encrypters.values()) {
|
||||
encs.addAll(encrypter.supportedEncryptionMethods());
|
||||
}
|
||||
|
||||
for (JWEDecrypter decrypter : decrypters.values()) {
|
||||
encs.addAll(decrypter.supportedEncryptionMethods());
|
||||
}
|
||||
for (JWEDecrypter decrypter : decrypters.values()) {
|
||||
encs.addAll(decrypter.supportedEncryptionMethods());
|
||||
}
|
||||
|
||||
return encs;
|
||||
}
|
||||
return encs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -122,18 +122,18 @@ public class JWKSetCacheService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.common.cache.CacheLoader#load(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public JwtEncryptionAndDecryptionService load(String key) throws Exception {
|
||||
@Override
|
||||
public JwtEncryptionAndDecryptionService load(String key) throws Exception {
|
||||
String jsonString = restTemplate.getForObject(key, String.class);
|
||||
JWKSet jwkSet = JWKSet.parse(jsonString);
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class JWKSetCacheService {
|
|||
JwtEncryptionAndDecryptionService service = new DefaultJwtEncryptionAndDecryptionService(keyStore);
|
||||
|
||||
return service;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ClientDetailsEntity implements ClientDetails {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final int DEFAULT_ID_TOKEN_VALIDITY_SECONDS = 600;
|
||||
private static final int DEFAULT_ID_TOKEN_VALIDITY_SECONDS = 600;
|
||||
|
||||
private static final long serialVersionUID = -1617727085733786296L;
|
||||
|
||||
|
|
|
@ -579,257 +579,257 @@ public class RegisteredClient {
|
|||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlgEmbed()
|
||||
*/
|
||||
public JWSAlgorithmEmbed getRequestObjectSigningAlgEmbed() {
|
||||
return client.getRequestObjectSigningAlgEmbed();
|
||||
}
|
||||
public JWSAlgorithmEmbed getRequestObjectSigningAlgEmbed() {
|
||||
return client.getRequestObjectSigningAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param requestObjectSigningAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||
*/
|
||||
public void setRequestObjectSigningAlgEmbed(JWSAlgorithmEmbed requestObjectSigningAlg) {
|
||||
client.setRequestObjectSigningAlgEmbed(requestObjectSigningAlg);
|
||||
}
|
||||
public void setRequestObjectSigningAlgEmbed(JWSAlgorithmEmbed requestObjectSigningAlg) {
|
||||
client.setRequestObjectSigningAlgEmbed(requestObjectSigningAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlgEmbed()
|
||||
*/
|
||||
public JWSAlgorithmEmbed getUserInfoSignedResponseAlgEmbed() {
|
||||
return client.getUserInfoSignedResponseAlgEmbed();
|
||||
}
|
||||
public JWSAlgorithmEmbed getUserInfoSignedResponseAlgEmbed() {
|
||||
return client.getUserInfoSignedResponseAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoSignedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||
*/
|
||||
public void setUserInfoSignedResponseAlgEmbed(JWSAlgorithmEmbed userInfoSignedResponseAlg) {
|
||||
client.setUserInfoSignedResponseAlgEmbed(userInfoSignedResponseAlg);
|
||||
}
|
||||
public void setUserInfoSignedResponseAlgEmbed(JWSAlgorithmEmbed userInfoSignedResponseAlg) {
|
||||
client.setUserInfoSignedResponseAlgEmbed(userInfoSignedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlgEmbed()
|
||||
*/
|
||||
public JWEAlgorithmEmbed getUserInfoEncryptedResponseAlgEmbed() {
|
||||
return client.getUserInfoEncryptedResponseAlgEmbed();
|
||||
}
|
||||
public JWEAlgorithmEmbed getUserInfoEncryptedResponseAlgEmbed() {
|
||||
return client.getUserInfoEncryptedResponseAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoEncryptedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
||||
*/
|
||||
public void setUserInfoEncryptedResponseAlgEmbed(JWEAlgorithmEmbed userInfoEncryptedResponseAlg) {
|
||||
client.setUserInfoEncryptedResponseAlgEmbed(userInfoEncryptedResponseAlg);
|
||||
}
|
||||
public void setUserInfoEncryptedResponseAlgEmbed(JWEAlgorithmEmbed userInfoEncryptedResponseAlg) {
|
||||
client.setUserInfoEncryptedResponseAlgEmbed(userInfoEncryptedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEncEmbed()
|
||||
*/
|
||||
public JWEEncryptionMethodEmbed getUserInfoEncryptedResponseEncEmbed() {
|
||||
return client.getUserInfoEncryptedResponseEncEmbed();
|
||||
}
|
||||
public JWEEncryptionMethodEmbed getUserInfoEncryptedResponseEncEmbed() {
|
||||
return client.getUserInfoEncryptedResponseEncEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoEncryptedResponseEnc
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
||||
*/
|
||||
public void setUserInfoEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed userInfoEncryptedResponseEnc) {
|
||||
client.setUserInfoEncryptedResponseEncEmbed(userInfoEncryptedResponseEnc);
|
||||
}
|
||||
public void setUserInfoEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed userInfoEncryptedResponseEnc) {
|
||||
client.setUserInfoEncryptedResponseEncEmbed(userInfoEncryptedResponseEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlgEmbed()
|
||||
*/
|
||||
public JWSAlgorithmEmbed getIdTokenSignedResponseAlgEmbed() {
|
||||
return client.getIdTokenSignedResponseAlgEmbed();
|
||||
}
|
||||
public JWSAlgorithmEmbed getIdTokenSignedResponseAlgEmbed() {
|
||||
return client.getIdTokenSignedResponseAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenSignedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||
*/
|
||||
public void setIdTokenSignedResponseAlgEmbed(JWSAlgorithmEmbed idTokenSignedResponseAlg) {
|
||||
client.setIdTokenSignedResponseAlgEmbed(idTokenSignedResponseAlg);
|
||||
}
|
||||
public void setIdTokenSignedResponseAlgEmbed(JWSAlgorithmEmbed idTokenSignedResponseAlg) {
|
||||
client.setIdTokenSignedResponseAlgEmbed(idTokenSignedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlgEmbed()
|
||||
*/
|
||||
public JWEAlgorithmEmbed getIdTokenEncryptedResponseAlgEmbed() {
|
||||
return client.getIdTokenEncryptedResponseAlgEmbed();
|
||||
}
|
||||
public JWEAlgorithmEmbed getIdTokenEncryptedResponseAlgEmbed() {
|
||||
return client.getIdTokenEncryptedResponseAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenEncryptedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
||||
*/
|
||||
public void setIdTokenEncryptedResponseAlgEmbed(JWEAlgorithmEmbed idTokenEncryptedResponseAlg) {
|
||||
client.setIdTokenEncryptedResponseAlgEmbed(idTokenEncryptedResponseAlg);
|
||||
}
|
||||
public void setIdTokenEncryptedResponseAlgEmbed(JWEAlgorithmEmbed idTokenEncryptedResponseAlg) {
|
||||
client.setIdTokenEncryptedResponseAlgEmbed(idTokenEncryptedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEncEmbed()
|
||||
*/
|
||||
public JWEEncryptionMethodEmbed getIdTokenEncryptedResponseEncEmbed() {
|
||||
return client.getIdTokenEncryptedResponseEncEmbed();
|
||||
}
|
||||
public JWEEncryptionMethodEmbed getIdTokenEncryptedResponseEncEmbed() {
|
||||
return client.getIdTokenEncryptedResponseEncEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenEncryptedResponseEnc
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
||||
*/
|
||||
public void setIdTokenEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc) {
|
||||
client.setIdTokenEncryptedResponseEncEmbed(idTokenEncryptedResponseEnc);
|
||||
}
|
||||
public void setIdTokenEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc) {
|
||||
client.setIdTokenEncryptedResponseEncEmbed(idTokenEncryptedResponseEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlg()
|
||||
*/
|
||||
public JWSAlgorithm getRequestObjectSigningAlg() {
|
||||
return client.getRequestObjectSigningAlg();
|
||||
}
|
||||
public JWSAlgorithm getRequestObjectSigningAlg() {
|
||||
return client.getRequestObjectSigningAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param requestObjectSigningAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||
*/
|
||||
public void setRequestObjectSigningAlg(JWSAlgorithm requestObjectSigningAlg) {
|
||||
client.setRequestObjectSigningAlg(requestObjectSigningAlg);
|
||||
}
|
||||
public void setRequestObjectSigningAlg(JWSAlgorithm requestObjectSigningAlg) {
|
||||
client.setRequestObjectSigningAlg(requestObjectSigningAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlg()
|
||||
*/
|
||||
public JWSAlgorithm getUserInfoSignedResponseAlg() {
|
||||
return client.getUserInfoSignedResponseAlg();
|
||||
}
|
||||
public JWSAlgorithm getUserInfoSignedResponseAlg() {
|
||||
return client.getUserInfoSignedResponseAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoSignedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||
*/
|
||||
public void setUserInfoSignedResponseAlg(JWSAlgorithm userInfoSignedResponseAlg) {
|
||||
client.setUserInfoSignedResponseAlg(userInfoSignedResponseAlg);
|
||||
}
|
||||
public void setUserInfoSignedResponseAlg(JWSAlgorithm userInfoSignedResponseAlg) {
|
||||
client.setUserInfoSignedResponseAlg(userInfoSignedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlg()
|
||||
*/
|
||||
public JWEAlgorithm getUserInfoEncryptedResponseAlg() {
|
||||
return client.getUserInfoEncryptedResponseAlg();
|
||||
}
|
||||
public JWEAlgorithm getUserInfoEncryptedResponseAlg() {
|
||||
return client.getUserInfoEncryptedResponseAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoEncryptedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
||||
*/
|
||||
public void setUserInfoEncryptedResponseAlg(JWEAlgorithm userInfoEncryptedResponseAlg) {
|
||||
client.setUserInfoEncryptedResponseAlg(userInfoEncryptedResponseAlg);
|
||||
}
|
||||
public void setUserInfoEncryptedResponseAlg(JWEAlgorithm userInfoEncryptedResponseAlg) {
|
||||
client.setUserInfoEncryptedResponseAlg(userInfoEncryptedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEnc()
|
||||
*/
|
||||
public EncryptionMethod getUserInfoEncryptedResponseEnc() {
|
||||
return client.getUserInfoEncryptedResponseEnc();
|
||||
}
|
||||
public EncryptionMethod getUserInfoEncryptedResponseEnc() {
|
||||
return client.getUserInfoEncryptedResponseEnc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userInfoEncryptedResponseEnc
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
||||
*/
|
||||
public void setUserInfoEncryptedResponseEnc(EncryptionMethod userInfoEncryptedResponseEnc) {
|
||||
client.setUserInfoEncryptedResponseEnc(userInfoEncryptedResponseEnc);
|
||||
}
|
||||
public void setUserInfoEncryptedResponseEnc(EncryptionMethod userInfoEncryptedResponseEnc) {
|
||||
client.setUserInfoEncryptedResponseEnc(userInfoEncryptedResponseEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlg()
|
||||
*/
|
||||
public JWSAlgorithm getIdTokenSignedResponseAlg() {
|
||||
return client.getIdTokenSignedResponseAlg();
|
||||
}
|
||||
public JWSAlgorithm getIdTokenSignedResponseAlg() {
|
||||
return client.getIdTokenSignedResponseAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenSignedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||
*/
|
||||
public void setIdTokenSignedResponseAlg(JWSAlgorithm idTokenSignedResponseAlg) {
|
||||
client.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg);
|
||||
}
|
||||
public void setIdTokenSignedResponseAlg(JWSAlgorithm idTokenSignedResponseAlg) {
|
||||
client.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlg()
|
||||
*/
|
||||
public JWEAlgorithm getIdTokenEncryptedResponseAlg() {
|
||||
return client.getIdTokenEncryptedResponseAlg();
|
||||
}
|
||||
public JWEAlgorithm getIdTokenEncryptedResponseAlg() {
|
||||
return client.getIdTokenEncryptedResponseAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenEncryptedResponseAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
||||
*/
|
||||
public void setIdTokenEncryptedResponseAlg(JWEAlgorithm idTokenEncryptedResponseAlg) {
|
||||
client.setIdTokenEncryptedResponseAlg(idTokenEncryptedResponseAlg);
|
||||
}
|
||||
public void setIdTokenEncryptedResponseAlg(JWEAlgorithm idTokenEncryptedResponseAlg) {
|
||||
client.setIdTokenEncryptedResponseAlg(idTokenEncryptedResponseAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEnc()
|
||||
*/
|
||||
public EncryptionMethod getIdTokenEncryptedResponseEnc() {
|
||||
return client.getIdTokenEncryptedResponseEnc();
|
||||
}
|
||||
public EncryptionMethod getIdTokenEncryptedResponseEnc() {
|
||||
return client.getIdTokenEncryptedResponseEnc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idTokenEncryptedResponseEnc
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
||||
*/
|
||||
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
||||
client.setIdTokenEncryptedResponseEnc(idTokenEncryptedResponseEnc);
|
||||
}
|
||||
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
||||
client.setIdTokenEncryptedResponseEnc(idTokenEncryptedResponseEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlgEmbed()
|
||||
*/
|
||||
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
||||
return client.getTokenEndpointAuthSigningAlgEmbed();
|
||||
}
|
||||
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
||||
return client.getTokenEndpointAuthSigningAlgEmbed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tokenEndpointAuthSigningAlgEmbed
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||
*/
|
||||
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
||||
client.setTokenEndpointAuthSigningAlgEmbed(tokenEndpointAuthSigningAlgEmbed);
|
||||
}
|
||||
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
||||
client.setTokenEndpointAuthSigningAlgEmbed(tokenEndpointAuthSigningAlgEmbed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlg()
|
||||
*/
|
||||
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
||||
return client.getTokenEndpointAuthSigningAlg();
|
||||
}
|
||||
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
||||
return client.getTokenEndpointAuthSigningAlg();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tokenEndpointAuthSigningAlg
|
||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||
*/
|
||||
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
||||
client.setTokenEndpointAuthSigningAlg(tokenEndpointAuthSigningAlg);
|
||||
}
|
||||
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
||||
client.setTokenEndpointAuthSigningAlg(tokenEndpointAuthSigningAlg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
|
|
@ -204,98 +204,98 @@ public class SystemScope {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (allowDynReg ? 1231 : 1237);
|
||||
result = prime * result + (defaultScope ? 1231 : 1237);
|
||||
result = prime * result + ((description == null) ? 0 : description.hashCode());
|
||||
result = prime * result + ((icon == null) ? 0 : icon.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + (structured ? 1231 : 1237);
|
||||
result = prime * result + ((structuredParamDescription == null) ? 0 : structuredParamDescription.hashCode());
|
||||
result = prime * result + ((structuredValue == null) ? 0 : structuredValue.hashCode());
|
||||
result = prime * result + ((value == null) ? 0 : value.hashCode());
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (allowDynReg ? 1231 : 1237);
|
||||
result = prime * result + (defaultScope ? 1231 : 1237);
|
||||
result = prime * result + ((description == null) ? 0 : description.hashCode());
|
||||
result = prime * result + ((icon == null) ? 0 : icon.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + (structured ? 1231 : 1237);
|
||||
result = prime * result + ((structuredParamDescription == null) ? 0 : structuredParamDescription.hashCode());
|
||||
result = prime * result + ((structuredValue == null) ? 0 : structuredValue.hashCode());
|
||||
result = prime * result + ((value == null) ? 0 : value.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof SystemScope)) {
|
||||
return false;
|
||||
}
|
||||
SystemScope other = (SystemScope) obj;
|
||||
if (allowDynReg != other.allowDynReg) {
|
||||
return false;
|
||||
}
|
||||
if (defaultScope != other.defaultScope) {
|
||||
return false;
|
||||
}
|
||||
if (description == null) {
|
||||
if (other.description != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!description.equals(other.description)) {
|
||||
return false;
|
||||
}
|
||||
if (icon == null) {
|
||||
if (other.icon != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!icon.equals(other.icon)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (structured != other.structured) {
|
||||
return false;
|
||||
}
|
||||
if (structuredParamDescription == null) {
|
||||
if (other.structuredParamDescription != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!structuredParamDescription.equals(other.structuredParamDescription)) {
|
||||
return false;
|
||||
}
|
||||
if (structuredValue == null) {
|
||||
if (other.structuredValue != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!structuredValue.equals(other.structuredValue)) {
|
||||
return false;
|
||||
}
|
||||
if (value == null) {
|
||||
if (other.value != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!value.equals(other.value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof SystemScope)) {
|
||||
return false;
|
||||
}
|
||||
SystemScope other = (SystemScope) obj;
|
||||
if (allowDynReg != other.allowDynReg) {
|
||||
return false;
|
||||
}
|
||||
if (defaultScope != other.defaultScope) {
|
||||
return false;
|
||||
}
|
||||
if (description == null) {
|
||||
if (other.description != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!description.equals(other.description)) {
|
||||
return false;
|
||||
}
|
||||
if (icon == null) {
|
||||
if (other.icon != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!icon.equals(other.icon)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (structured != other.structured) {
|
||||
return false;
|
||||
}
|
||||
if (structuredParamDescription == null) {
|
||||
if (other.structuredParamDescription != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!structuredParamDescription.equals(other.structuredParamDescription)) {
|
||||
return false;
|
||||
}
|
||||
if (structuredValue == null) {
|
||||
if (other.structuredValue != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!structuredValue.equals(other.structuredValue)) {
|
||||
return false;
|
||||
}
|
||||
if (value == null) {
|
||||
if (other.value != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!value.equals(other.value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SystemScope [id=" + id + ", value=" + value + ", description=" + description + ", icon=" + icon + ", allowDynReg=" + allowDynReg + ", defaultScope=" + defaultScope + ", structured=" + structured + ", structuredParamDescription=" + structuredParamDescription + ", structuredValue="
|
||||
+ structuredValue + "]";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SystemScope [id=" + id + ", value=" + value + ", description=" + description + ", icon=" + icon + ", allowDynReg=" + allowDynReg + ", defaultScope=" + defaultScope + ", structured=" + structured + ", structuredParamDescription=" + structuredParamDescription + ", structuredValue="
|
||||
+ structuredValue + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,14 @@
|
|||
package org.mitre.openid.connect;
|
||||
|
||||
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsArray;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsDate;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJweAlgorithm;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJweEncryptionMethod;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsJwsAlgorithm;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsString;
|
||||
import static org.mitre.discovery.util.JsonUtils.getAsStringSet;
|
||||
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity.AppType;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod;
|
||||
|
@ -33,8 +41,6 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import static org.mitre.discovery.util.JsonUtils.*;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -149,85 +149,85 @@ public class Address {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((country == null) ? 0 : country.hashCode());
|
||||
result = prime * result + ((formatted == null) ? 0 : formatted.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((locality == null) ? 0 : locality.hashCode());
|
||||
result = prime * result + ((postalCode == null) ? 0 : postalCode.hashCode());
|
||||
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
||||
result = prime * result + ((streetAddress == null) ? 0 : streetAddress.hashCode());
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((country == null) ? 0 : country.hashCode());
|
||||
result = prime * result + ((formatted == null) ? 0 : formatted.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((locality == null) ? 0 : locality.hashCode());
|
||||
result = prime * result + ((postalCode == null) ? 0 : postalCode.hashCode());
|
||||
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
||||
result = prime * result + ((streetAddress == null) ? 0 : streetAddress.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof Address)) {
|
||||
return false;
|
||||
}
|
||||
Address other = (Address) obj;
|
||||
if (country == null) {
|
||||
if (other.country != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!country.equals(other.country)) {
|
||||
return false;
|
||||
}
|
||||
if (formatted == null) {
|
||||
if (other.formatted != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!formatted.equals(other.formatted)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (locality == null) {
|
||||
if (other.locality != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!locality.equals(other.locality)) {
|
||||
return false;
|
||||
}
|
||||
if (postalCode == null) {
|
||||
if (other.postalCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!postalCode.equals(other.postalCode)) {
|
||||
return false;
|
||||
}
|
||||
if (region == null) {
|
||||
if (other.region != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!region.equals(other.region)) {
|
||||
return false;
|
||||
}
|
||||
if (streetAddress == null) {
|
||||
if (other.streetAddress != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!streetAddress.equals(other.streetAddress)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof Address)) {
|
||||
return false;
|
||||
}
|
||||
Address other = (Address) obj;
|
||||
if (country == null) {
|
||||
if (other.country != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!country.equals(other.country)) {
|
||||
return false;
|
||||
}
|
||||
if (formatted == null) {
|
||||
if (other.formatted != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!formatted.equals(other.formatted)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (locality == null) {
|
||||
if (other.locality != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!locality.equals(other.locality)) {
|
||||
return false;
|
||||
}
|
||||
if (postalCode == null) {
|
||||
if (other.postalCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!postalCode.equals(other.postalCode)) {
|
||||
return false;
|
||||
}
|
||||
if (region == null) {
|
||||
if (other.region != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!region.equals(other.region)) {
|
||||
return false;
|
||||
}
|
||||
if (streetAddress == null) {
|
||||
if (other.streetAddress != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!streetAddress.equals(other.streetAddress)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -336,19 +336,19 @@ public class DefaultUserInfo implements UserInfo {
|
|||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.model.UserInfo#getPhoneNumberVerified()
|
||||
*/
|
||||
@Override
|
||||
@Basic
|
||||
@Column(name="phone_number_verified")
|
||||
public Boolean getPhoneNumberVerified() {
|
||||
return phoneNumberVerified;
|
||||
}
|
||||
@Override
|
||||
@Basic
|
||||
@Column(name="phone_number_verified")
|
||||
public Boolean getPhoneNumberVerified() {
|
||||
return phoneNumberVerified;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.model.UserInfo#setPhoneNumberVerified(java.lang.Boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setPhoneNumberVerified(Boolean phoneNumberVerified) {
|
||||
this.phoneNumberVerified = phoneNumberVerified;
|
||||
}
|
||||
@Override
|
||||
public void setPhoneNumberVerified(Boolean phoneNumberVerified) {
|
||||
this.phoneNumberVerified = phoneNumberVerified;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.model.UserInfo#getAddress()
|
||||
*/
|
||||
|
@ -494,197 +494,197 @@ public class DefaultUserInfo implements UserInfo {
|
|||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((address == null) ? 0 : address.hashCode());
|
||||
result = prime * result + ((birthdate == null) ? 0 : birthdate.hashCode());
|
||||
result = prime * result + ((email == null) ? 0 : email.hashCode());
|
||||
result = prime * result + ((emailVerified == null) ? 0 : emailVerified.hashCode());
|
||||
result = prime * result + ((familyName == null) ? 0 : familyName.hashCode());
|
||||
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
|
||||
result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((locale == null) ? 0 : locale.hashCode());
|
||||
result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
result = prime * result + ((nickname == null) ? 0 : nickname.hashCode());
|
||||
result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
|
||||
result = prime * result + ((phoneNumberVerified == null) ? 0 : phoneNumberVerified.hashCode());
|
||||
result = prime * result + ((picture == null) ? 0 : picture.hashCode());
|
||||
result = prime * result + ((preferredUsername == null) ? 0 : preferredUsername.hashCode());
|
||||
result = prime * result + ((profile == null) ? 0 : profile.hashCode());
|
||||
result = prime * result + ((sub == null) ? 0 : sub.hashCode());
|
||||
result = prime * result + ((updatedTime == null) ? 0 : updatedTime.hashCode());
|
||||
result = prime * result + ((website == null) ? 0 : website.hashCode());
|
||||
result = prime * result + ((zoneinfo == null) ? 0 : zoneinfo.hashCode());
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((address == null) ? 0 : address.hashCode());
|
||||
result = prime * result + ((birthdate == null) ? 0 : birthdate.hashCode());
|
||||
result = prime * result + ((email == null) ? 0 : email.hashCode());
|
||||
result = prime * result + ((emailVerified == null) ? 0 : emailVerified.hashCode());
|
||||
result = prime * result + ((familyName == null) ? 0 : familyName.hashCode());
|
||||
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
|
||||
result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((locale == null) ? 0 : locale.hashCode());
|
||||
result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
result = prime * result + ((nickname == null) ? 0 : nickname.hashCode());
|
||||
result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
|
||||
result = prime * result + ((phoneNumberVerified == null) ? 0 : phoneNumberVerified.hashCode());
|
||||
result = prime * result + ((picture == null) ? 0 : picture.hashCode());
|
||||
result = prime * result + ((preferredUsername == null) ? 0 : preferredUsername.hashCode());
|
||||
result = prime * result + ((profile == null) ? 0 : profile.hashCode());
|
||||
result = prime * result + ((sub == null) ? 0 : sub.hashCode());
|
||||
result = prime * result + ((updatedTime == null) ? 0 : updatedTime.hashCode());
|
||||
result = prime * result + ((website == null) ? 0 : website.hashCode());
|
||||
result = prime * result + ((zoneinfo == null) ? 0 : zoneinfo.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof DefaultUserInfo)) {
|
||||
return false;
|
||||
}
|
||||
DefaultUserInfo other = (DefaultUserInfo) obj;
|
||||
if (address == null) {
|
||||
if (other.address != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!address.equals(other.address)) {
|
||||
return false;
|
||||
}
|
||||
if (birthdate == null) {
|
||||
if (other.birthdate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!birthdate.equals(other.birthdate)) {
|
||||
return false;
|
||||
}
|
||||
if (email == null) {
|
||||
if (other.email != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!email.equals(other.email)) {
|
||||
return false;
|
||||
}
|
||||
if (emailVerified == null) {
|
||||
if (other.emailVerified != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!emailVerified.equals(other.emailVerified)) {
|
||||
return false;
|
||||
}
|
||||
if (familyName == null) {
|
||||
if (other.familyName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!familyName.equals(other.familyName)) {
|
||||
return false;
|
||||
}
|
||||
if (gender == null) {
|
||||
if (other.gender != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!gender.equals(other.gender)) {
|
||||
return false;
|
||||
}
|
||||
if (givenName == null) {
|
||||
if (other.givenName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!givenName.equals(other.givenName)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (locale == null) {
|
||||
if (other.locale != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!locale.equals(other.locale)) {
|
||||
return false;
|
||||
}
|
||||
if (middleName == null) {
|
||||
if (other.middleName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!middleName.equals(other.middleName)) {
|
||||
return false;
|
||||
}
|
||||
if (name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (nickname == null) {
|
||||
if (other.nickname != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!nickname.equals(other.nickname)) {
|
||||
return false;
|
||||
}
|
||||
if (phoneNumber == null) {
|
||||
if (other.phoneNumber != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!phoneNumber.equals(other.phoneNumber)) {
|
||||
return false;
|
||||
}
|
||||
if (phoneNumberVerified == null) {
|
||||
if (other.phoneNumberVerified != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!phoneNumberVerified.equals(other.phoneNumberVerified)) {
|
||||
return false;
|
||||
}
|
||||
if (picture == null) {
|
||||
if (other.picture != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!picture.equals(other.picture)) {
|
||||
return false;
|
||||
}
|
||||
if (preferredUsername == null) {
|
||||
if (other.preferredUsername != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!preferredUsername.equals(other.preferredUsername)) {
|
||||
return false;
|
||||
}
|
||||
if (profile == null) {
|
||||
if (other.profile != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!profile.equals(other.profile)) {
|
||||
return false;
|
||||
}
|
||||
if (sub == null) {
|
||||
if (other.sub != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!sub.equals(other.sub)) {
|
||||
return false;
|
||||
}
|
||||
if (updatedTime == null) {
|
||||
if (other.updatedTime != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!updatedTime.equals(other.updatedTime)) {
|
||||
return false;
|
||||
}
|
||||
if (website == null) {
|
||||
if (other.website != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!website.equals(other.website)) {
|
||||
return false;
|
||||
}
|
||||
if (zoneinfo == null) {
|
||||
if (other.zoneinfo != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!zoneinfo.equals(other.zoneinfo)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof DefaultUserInfo)) {
|
||||
return false;
|
||||
}
|
||||
DefaultUserInfo other = (DefaultUserInfo) obj;
|
||||
if (address == null) {
|
||||
if (other.address != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!address.equals(other.address)) {
|
||||
return false;
|
||||
}
|
||||
if (birthdate == null) {
|
||||
if (other.birthdate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!birthdate.equals(other.birthdate)) {
|
||||
return false;
|
||||
}
|
||||
if (email == null) {
|
||||
if (other.email != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!email.equals(other.email)) {
|
||||
return false;
|
||||
}
|
||||
if (emailVerified == null) {
|
||||
if (other.emailVerified != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!emailVerified.equals(other.emailVerified)) {
|
||||
return false;
|
||||
}
|
||||
if (familyName == null) {
|
||||
if (other.familyName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!familyName.equals(other.familyName)) {
|
||||
return false;
|
||||
}
|
||||
if (gender == null) {
|
||||
if (other.gender != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!gender.equals(other.gender)) {
|
||||
return false;
|
||||
}
|
||||
if (givenName == null) {
|
||||
if (other.givenName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!givenName.equals(other.givenName)) {
|
||||
return false;
|
||||
}
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (locale == null) {
|
||||
if (other.locale != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!locale.equals(other.locale)) {
|
||||
return false;
|
||||
}
|
||||
if (middleName == null) {
|
||||
if (other.middleName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!middleName.equals(other.middleName)) {
|
||||
return false;
|
||||
}
|
||||
if (name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (nickname == null) {
|
||||
if (other.nickname != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!nickname.equals(other.nickname)) {
|
||||
return false;
|
||||
}
|
||||
if (phoneNumber == null) {
|
||||
if (other.phoneNumber != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!phoneNumber.equals(other.phoneNumber)) {
|
||||
return false;
|
||||
}
|
||||
if (phoneNumberVerified == null) {
|
||||
if (other.phoneNumberVerified != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!phoneNumberVerified.equals(other.phoneNumberVerified)) {
|
||||
return false;
|
||||
}
|
||||
if (picture == null) {
|
||||
if (other.picture != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!picture.equals(other.picture)) {
|
||||
return false;
|
||||
}
|
||||
if (preferredUsername == null) {
|
||||
if (other.preferredUsername != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!preferredUsername.equals(other.preferredUsername)) {
|
||||
return false;
|
||||
}
|
||||
if (profile == null) {
|
||||
if (other.profile != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!profile.equals(other.profile)) {
|
||||
return false;
|
||||
}
|
||||
if (sub == null) {
|
||||
if (other.sub != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!sub.equals(other.sub)) {
|
||||
return false;
|
||||
}
|
||||
if (updatedTime == null) {
|
||||
if (other.updatedTime != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!updatedTime.equals(other.updatedTime)) {
|
||||
return false;
|
||||
}
|
||||
if (website == null) {
|
||||
if (other.website != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!website.equals(other.website)) {
|
||||
return false;
|
||||
}
|
||||
if (zoneinfo == null) {
|
||||
if (other.zoneinfo != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!zoneinfo.equals(other.zoneinfo)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ public interface PairwiseIdentifierRepository {
|
|||
* @param sectorIdentifierUri
|
||||
* @return
|
||||
*/
|
||||
public PairwiseIdentifier getBySectorIdentifier(String sub, String sectorIdentifierUri);
|
||||
public PairwiseIdentifier getBySectorIdentifier(String sub, String sectorIdentifierUri);
|
||||
|
||||
/**
|
||||
* Save a pairwise identifier to the database.
|
||||
*
|
||||
* @param pairwise
|
||||
*/
|
||||
public void save(PairwiseIdentifier pairwise);
|
||||
/**
|
||||
* Save a pairwise identifier to the database.
|
||||
*
|
||||
* @param pairwise
|
||||
*/
|
||||
public void save(PairwiseIdentifier pairwise);
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@ public interface PairwiseIdentiferService {
|
|||
* @param client
|
||||
* @return
|
||||
*/
|
||||
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client);
|
||||
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client);
|
||||
|
||||
}
|
||||
|
|
|
@ -51,13 +51,13 @@ import com.google.gson.JsonSerializer;
|
|||
public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
private Gson gson = new GsonBuilder()
|
||||
.registerTypeHierarchyAdapter(GrantedAuthority.class, new JsonSerializer<GrantedAuthority>() {
|
||||
@Override
|
||||
public JsonElement serialize(GrantedAuthority src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(src.getAuthority());
|
||||
}
|
||||
})
|
||||
.create();
|
||||
.registerTypeHierarchyAdapter(GrantedAuthority.class, new JsonSerializer<GrantedAuthority>() {
|
||||
@Override
|
||||
public JsonElement serialize(GrantedAuthority src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(src.getAuthority());
|
||||
}
|
||||
})
|
||||
.create();
|
||||
|
||||
@Autowired
|
||||
private UserInfoService userInfoService;
|
||||
|
@ -66,7 +66,7 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
|||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
||||
|
||||
if (modelAndView != null && !modelAndView.getModel().containsKey("userInfo")) { // skip checking at all if we have no model and view to hand the user to
|
||||
// or if there's already a userInfo object in there
|
||||
// or if there's already a userInfo object in there
|
||||
|
||||
// TODO: this is a patch to get around a potential information leak from #492
|
||||
if (!(modelAndView.getView() instanceof RedirectView)) {
|
||||
|
|
|
@ -28,12 +28,12 @@ import javax.persistence.EntityManager;
|
|||
public class JpaUtil {
|
||||
public static <T> T getSingleResult(List<T> list) {
|
||||
switch(list.size()) {
|
||||
case 0:
|
||||
return null;
|
||||
case 1:
|
||||
return list.get(0);
|
||||
default:
|
||||
throw new IllegalStateException("Expected single result, got " + list.size());
|
||||
case 0:
|
||||
return null;
|
||||
case 1:
|
||||
return list.get(0);
|
||||
default:
|
||||
throw new IllegalStateException("Expected single result, got " + list.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.discovery.util;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.web.util.UriComponents;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
*/
|
||||
package org.mitre.jose;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.nimbusds.jose.EncryptionMethod;
|
||||
import com.nimbusds.jose.JWEAlgorithm;
|
||||
import com.nimbusds.jose.JWSAlgorithm;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
*
|
||||
* These tests make sure that the algorithm name processing
|
||||
|
|
|
@ -76,19 +76,19 @@ public class TestDefaultJwtEncryptionAndDecryptionService {
|
|||
"YgyD3JR_MB_4NUJW_TqOQtwHYbxevoJArm-L5StowjzGy-_bq6Gw"), // n
|
||||
new Base64URL("AQAB"), // e
|
||||
new Base64URL("kLdtIj6GbDks_ApCSTYQtelcNttlKiOyPzMrXHeI-yk1F7-kpDxY4-WY5N" +
|
||||
"WV5KntaEeXS1j82E375xxhWMHXyvjYecPT9fpwR_M9gV8n9Hrh2anTpTD9" +
|
||||
"3Dt62ypW3yDsJzBnTnrYu1iwWRgBKrEYY46qAZIrA2xAwnm2X7uGR1hghk" +
|
||||
"qDp0Vqj3kbSCz1XyfCs6_LehBwtxHIyh8Ripy40p24moOAbgxVw3rxT_vl" +
|
||||
"t3UVe4WO3JkJOzlpUf-KTVI2Ptgm-dARxTEtE-id-4OJr0h-K-VFs3VSnd" +
|
||||
"VTIznSxfyrj8ILL6MG_Uv8YAu7VILSB3lOW085-4qE3DzgrTjgyQ"), // d
|
||||
Use.ENCRYPTION, JWEAlgorithm.RSA_OAEP, RSAkid, null, null, null);
|
||||
"WV5KntaEeXS1j82E375xxhWMHXyvjYecPT9fpwR_M9gV8n9Hrh2anTpTD9" +
|
||||
"3Dt62ypW3yDsJzBnTnrYu1iwWRgBKrEYY46qAZIrA2xAwnm2X7uGR1hghk" +
|
||||
"qDp0Vqj3kbSCz1XyfCs6_LehBwtxHIyh8Ripy40p24moOAbgxVw3rxT_vl" +
|
||||
"t3UVe4WO3JkJOzlpUf-KTVI2Ptgm-dARxTEtE-id-4OJr0h-K-VFs3VSnd" +
|
||||
"VTIznSxfyrj8ILL6MG_Uv8YAu7VILSB3lOW085-4qE3DzgrTjgyQ"), // d
|
||||
Use.ENCRYPTION, JWEAlgorithm.RSA_OAEP, RSAkid, null, null, null);
|
||||
|
||||
// AES key wrap not yet tested
|
||||
// private String AESkid = "aes123";
|
||||
// private JWK AESjwk = new OctetSequenceKey(new Base64URL("GawgguFyGrWKav7AX4VKUg"), Use.ENCRYPTION, JWEAlgorithm.A128KW, AESkid);
|
||||
//
|
||||
// private Map<String, JWK> keys = new ImmutableMap.Builder<String, JWK>().
|
||||
// put(RSAkid, RSAjwk).put(AESkid, AESjwk).build();
|
||||
// private String AESkid = "aes123";
|
||||
// private JWK AESjwk = new OctetSequenceKey(new Base64URL("GawgguFyGrWKav7AX4VKUg"), Use.ENCRYPTION, JWEAlgorithm.A128KW, AESkid);
|
||||
//
|
||||
// private Map<String, JWK> keys = new ImmutableMap.Builder<String, JWK>().
|
||||
// put(RSAkid, RSAjwk).put(AESkid, AESjwk).build();
|
||||
|
||||
private Map<String, JWK> keys = new ImmutableMap.Builder<String, JWK>().
|
||||
put(RSAkid, RSAjwk).build();
|
||||
|
|
|
@ -19,18 +19,16 @@
|
|||
*/
|
||||
package org.mitre.oauth2.model;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mitre.jose.JWEAlgorithmEmbed;
|
||||
import org.mitre.jose.JWEEncryptionMethodEmbed;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.nimbusds.jose.EncryptionMethod;
|
||||
import com.nimbusds.jose.JWEAlgorithm;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -19,18 +19,16 @@
|
|||
*/
|
||||
package org.mitre.oauth2.model;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mitre.jose.JWEAlgorithmEmbed;
|
||||
import org.mitre.jose.JWEEncryptionMethodEmbed;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.nimbusds.jose.EncryptionMethod;
|
||||
import com.nimbusds.jose.JWEAlgorithm;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -19,11 +19,12 @@
|
|||
*/
|
||||
package org.mitre.openid.connect;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mitre.jose.JWEAlgorithmEmbed;
|
||||
import org.mitre.jose.JWEEncryptionMethodEmbed;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
||||
import org.mitre.oauth2.model.RegisteredClient;
|
||||
|
||||
|
@ -33,9 +34,6 @@ import com.google.gson.JsonObject;
|
|||
import com.nimbusds.jose.EncryptionMethod;
|
||||
import com.nimbusds.jose.JWEAlgorithm;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.config;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.config;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -117,19 +117,19 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
// check the sector URI
|
||||
if (!Strings.isNullOrEmpty(client.getSectorIdentifierUri())) {
|
||||
try {
|
||||
List<String> redirects = sectorRedirects.get(client.getSectorIdentifierUri());
|
||||
List<String> redirects = sectorRedirects.get(client.getSectorIdentifierUri());
|
||||
|
||||
if (client.getRegisteredRedirectUri() != null) {
|
||||
for (String uri : client.getRegisteredRedirectUri()) {
|
||||
if (!redirects.contains(uri)) {
|
||||
throw new IllegalArgumentException("Requested Redirect URI " + uri + " is not listed at sector identifier " + redirects);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (client.getRegisteredRedirectUri() != null) {
|
||||
for (String uri : client.getRegisteredRedirectUri()) {
|
||||
if (!redirects.contains(uri)) {
|
||||
throw new IllegalArgumentException("Requested Redirect URI " + uri + " is not listed at sector identifier " + redirects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalArgumentException("Unable to load sector identifier URI: " + client.getSectorIdentifierUri());
|
||||
}
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalArgumentException("Unable to load sector identifier URI: " + client.getSectorIdentifierUri());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -218,19 +218,19 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
// check the sector URI
|
||||
if (!Strings.isNullOrEmpty(newClient.getSectorIdentifierUri())) {
|
||||
try {
|
||||
List<String> redirects = sectorRedirects.get(newClient.getSectorIdentifierUri());
|
||||
List<String> redirects = sectorRedirects.get(newClient.getSectorIdentifierUri());
|
||||
|
||||
if (newClient.getRegisteredRedirectUri() != null) {
|
||||
for (String uri : newClient.getRegisteredRedirectUri()) {
|
||||
if (!redirects.contains(uri)) {
|
||||
throw new IllegalArgumentException("Requested Redirect URI " + uri + " is not listed at sector identifier " + redirects);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newClient.getRegisteredRedirectUri() != null) {
|
||||
for (String uri : newClient.getRegisteredRedirectUri()) {
|
||||
if (!redirects.contains(uri)) {
|
||||
throw new IllegalArgumentException("Requested Redirect URI " + uri + " is not listed at sector identifier " + redirects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalArgumentException("Unable to load sector identifier URI: " + newClient.getSectorIdentifierUri());
|
||||
}
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalArgumentException("Unable to load sector identifier URI: " + newClient.getSectorIdentifierUri());
|
||||
}
|
||||
}
|
||||
|
||||
// make sure a client doesn't get any special system scopes
|
||||
|
@ -270,32 +270,32 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
/**
|
||||
* Utility class to load a sector identifier's set of authorized redirect URIs.
|
||||
*
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class SectorIdentifierLoader extends CacheLoader<String, List<String>> {
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
private class SectorIdentifierLoader extends CacheLoader<String, List<String>> {
|
||||
private HttpClient httpClient = new DefaultHttpClient();
|
||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||
private JsonParser parser = new JsonParser();
|
||||
|
||||
@Override
|
||||
public List<String> load(String key) throws Exception {
|
||||
@Override
|
||||
public List<String> load(String key) throws Exception {
|
||||
|
||||
if (!key.startsWith("https")) {
|
||||
// TODO: this should optionally throw an error (#506)
|
||||
logger.error("Sector identifier doesn't start with https, loading anyway...");
|
||||
}
|
||||
if (!key.startsWith("https")) {
|
||||
// TODO: this should optionally throw an error (#506)
|
||||
logger.error("Sector identifier doesn't start with https, loading anyway...");
|
||||
}
|
||||
|
||||
// key is the sector URI
|
||||
// key is the sector URI
|
||||
String jsonString = restTemplate.getForObject(key, String.class);
|
||||
JsonElement json = parser.parse(jsonString);
|
||||
|
||||
if (json.isJsonArray()) {
|
||||
List<String> redirectUris = new ArrayList<String>();
|
||||
for (JsonElement el : json.getAsJsonArray()) {
|
||||
redirectUris.add(el.getAsString());
|
||||
}
|
||||
redirectUris.add(el.getAsString());
|
||||
}
|
||||
|
||||
logger.info("Found " + redirectUris + " for sector " + key);
|
||||
|
||||
|
@ -304,8 +304,8 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -204,40 +204,40 @@ public class DefaultSystemScopeService implements SystemScopeService {
|
|||
/* (non-Javadoc)
|
||||
* @see org.mitre.oauth2.service.SystemScopeService#scopesMatch(java.util.Set, java.util.Set)
|
||||
*/
|
||||
@Override
|
||||
public boolean scopesMatch(Set<String> expected, Set<String> actual) {
|
||||
@Override
|
||||
public boolean scopesMatch(Set<String> expected, Set<String> actual) {
|
||||
|
||||
Set<SystemScope> ex = fromStrings(expected);
|
||||
Set<SystemScope> act = fromStrings(actual);
|
||||
Set<SystemScope> ex = fromStrings(expected);
|
||||
Set<SystemScope> act = fromStrings(actual);
|
||||
|
||||
for (SystemScope actScope : act) {
|
||||
// first check to see if there's an exact match
|
||||
if (!ex.contains(actScope)) {
|
||||
// we didn't find an exact match
|
||||
if (actScope.isStructured() && !Strings.isNullOrEmpty(actScope.getStructuredValue())) {
|
||||
// if we didn't get an exact match but the actual scope is structured, we need to check further
|
||||
for (SystemScope actScope : act) {
|
||||
// first check to see if there's an exact match
|
||||
if (!ex.contains(actScope)) {
|
||||
// we didn't find an exact match
|
||||
if (actScope.isStructured() && !Strings.isNullOrEmpty(actScope.getStructuredValue())) {
|
||||
// if we didn't get an exact match but the actual scope is structured, we need to check further
|
||||
|
||||
// first, find the "base" scope for this
|
||||
SystemScope base = getByValue(actScope.getValue());
|
||||
if (!ex.contains(base)) {
|
||||
// if the expected doesn't contain the base scope, fail
|
||||
return false;
|
||||
} else {
|
||||
// we did find an exact match, need to check the rest
|
||||
}
|
||||
} else {
|
||||
// the scope wasn't structured, fail now
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// if we did find an exact match, we need to check the rest
|
||||
}
|
||||
}
|
||||
// first, find the "base" scope for this
|
||||
SystemScope base = getByValue(actScope.getValue());
|
||||
if (!ex.contains(base)) {
|
||||
// if the expected doesn't contain the base scope, fail
|
||||
return false;
|
||||
} else {
|
||||
// we did find an exact match, need to check the rest
|
||||
}
|
||||
} else {
|
||||
// the scope wasn't structured, fail now
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// if we did find an exact match, we need to check the rest
|
||||
}
|
||||
}
|
||||
|
||||
// if we got all the way down here, the setup passed
|
||||
return true;
|
||||
// if we got all the way down here, the setup passed
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> removeRestrictedScopes(Set<String> scopes) {
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
*/
|
||||
package org.mitre.oauth2.token;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.mitre.oauth2.service.SystemScopeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth2.common.exceptions.InvalidScopeException;
|
||||
import org.springframework.security.oauth2.common.util.OAuth2Utils;
|
||||
import org.springframework.security.oauth2.provider.AuthorizationRequest;
|
||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||
import org.springframework.security.oauth2.provider.OAuth2RequestValidator;
|
||||
|
|
|
@ -36,9 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
|
||||
import org.springframework.security.oauth2.common.util.OAuth2Utils;
|
||||
import org.springframework.security.oauth2.provider.AuthorizationRequest;
|
||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||
import org.springframework.security.oauth2.provider.DefaultOAuth2RequestFactory;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Request;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
@ -321,7 +319,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
|
|||
String prompt = claims.getStringClaim("prompt");
|
||||
if (prompt != null) {
|
||||
if (!prompt.equals(request.getExtensions().get("prompt"))) {
|
||||
logger.info("Mismatch between request object and regular parameter for prompt, using request object");
|
||||
logger.info("Mismatch between request object and regular parameter for prompt, using request object");
|
||||
}
|
||||
request.getExtensions().put("prompt", prompt);
|
||||
}
|
||||
|
@ -352,14 +350,14 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
|
|||
* @param claimRequestString
|
||||
* @return
|
||||
*/
|
||||
private JsonObject parseClaimRequest(String claimRequestString) {
|
||||
JsonElement el = parser .parse(claimRequestString);
|
||||
if (el != null && el.isJsonObject()) {
|
||||
return el.getAsJsonObject();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private JsonObject parseClaimRequest(String claimRequestString) {
|
||||
JsonElement el = parser .parse(claimRequestString);
|
||||
if (el != null && el.isJsonObject()) {
|
||||
return el.getAsJsonObject();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a symmetric signing and validation service for the given client
|
||||
|
@ -367,34 +365,34 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
|
|||
* @param client
|
||||
* @return
|
||||
*/
|
||||
private JwtSigningAndValidationService getSymmetricValidtor(ClientDetailsEntity client) {
|
||||
private JwtSigningAndValidationService getSymmetricValidtor(ClientDetailsEntity client) {
|
||||
|
||||
if (client == null) {
|
||||
logger.error("Couldn't create symmetric validator for null client");
|
||||
return null;
|
||||
}
|
||||
if (client == null) {
|
||||
logger.error("Couldn't create symmetric validator for null client");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Strings.isNullOrEmpty(client.getClientSecret())) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId() + " without a client secret");
|
||||
return null;
|
||||
}
|
||||
if (Strings.isNullOrEmpty(client.getClientSecret())) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId() + " without a client secret");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
|
||||
JWK jwk = new OctetSequenceKey(Base64URL.encode(client.getClientSecret()), Use.SIGNATURE, null, client.getClientId(), null, null, null);
|
||||
Map<String, JWK> keys = ImmutableMap.of(client.getClientId(), jwk);
|
||||
JwtSigningAndValidationService service = new DefaultJwtSigningAndValidationService(keys);
|
||||
JWK jwk = new OctetSequenceKey(Base64URL.encode(client.getClientSecret()), Use.SIGNATURE, null, client.getClientId(), null, null, null);
|
||||
Map<String, JWK> keys = ImmutableMap.of(client.getClientId(), jwk);
|
||||
JwtSigningAndValidationService service = new DefaultJwtSigningAndValidationService(keys);
|
||||
|
||||
return service;
|
||||
return service;
|
||||
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId(), e);
|
||||
} catch (InvalidKeySpecException e) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId(), e);
|
||||
}
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId(), e);
|
||||
} catch (InvalidKeySpecException e) {
|
||||
logger.error("Couldn't create symmetric validator for client " + client.getClientId(), e);
|
||||
}
|
||||
|
||||
return null;
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,8 +43,6 @@ import org.springframework.security.oauth2.provider.OAuth2RequestFactory;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.GenericFilterBean;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
@ -92,31 +90,31 @@ public class PromptFilter extends GenericFilterBean {
|
|||
}
|
||||
} else if (prompt.equals("login")) {
|
||||
|
||||
// first see if the user's already been prompted in this session
|
||||
// first see if the user's already been prompted in this session
|
||||
HttpSession session = request.getSession();
|
||||
if (session.getAttribute(PROMPTED) == null) {
|
||||
// user hasn't been PROMPTED yet, we need to check
|
||||
if (session.getAttribute(PROMPTED) == null) {
|
||||
// user hasn't been PROMPTED yet, we need to check
|
||||
|
||||
session.setAttribute(PROMPT_REQUESTED, Boolean.TRUE);
|
||||
session.setAttribute(PROMPT_REQUESTED, Boolean.TRUE);
|
||||
|
||||
// see if the user's logged in
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null) {
|
||||
// user's been logged in already (by session management)
|
||||
// log them out and continue
|
||||
SecurityContextHolder.getContext().setAuthentication(null);
|
||||
chain.doFilter(req, res);
|
||||
} else {
|
||||
// user hasn't been logged in yet, we can keep going since we'll get there
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
} else {
|
||||
// user has been PROMPTED, we're fine
|
||||
// see if the user's logged in
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null) {
|
||||
// user's been logged in already (by session management)
|
||||
// log them out and continue
|
||||
SecurityContextHolder.getContext().setAuthentication(null);
|
||||
chain.doFilter(req, res);
|
||||
} else {
|
||||
// user hasn't been logged in yet, we can keep going since we'll get there
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
} else {
|
||||
// user has been PROMPTED, we're fine
|
||||
|
||||
// but first, undo the prompt tag
|
||||
session.removeAttribute(PROMPTED);
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
// but first, undo the prompt tag
|
||||
session.removeAttribute(PROMPTED);
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
} else {
|
||||
// prompt parameter is a value we don't care about, not our business
|
||||
chain.doFilter(req, res);
|
||||
|
@ -133,12 +131,12 @@ public class PromptFilter extends GenericFilterBean {
|
|||
long seconds = (now.getTime() - authTime.getTime()) / 1000;
|
||||
if (seconds > max) {
|
||||
// session is too old, log the user out and continue
|
||||
SecurityContextHolder.getContext().setAuthentication(null);
|
||||
SecurityContextHolder.getContext().setAuthentication(null);
|
||||
}
|
||||
}
|
||||
|
||||
chain.doFilter(req, res);
|
||||
} else {
|
||||
} else {
|
||||
// no prompt parameter, not our business
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
|
@ -149,16 +147,16 @@ public class PromptFilter extends GenericFilterBean {
|
|||
* @param parameterMap
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> createRequestMap(Map<String, String[]> parameterMap) {
|
||||
Map<String, String> requestMap = new HashMap<String, String>();
|
||||
for (String key : parameterMap.keySet()) {
|
||||
String[] val = parameterMap.get(key);
|
||||
private Map<String, String> createRequestMap(Map<String, String[]> parameterMap) {
|
||||
Map<String, String> requestMap = new HashMap<String, String>();
|
||||
for (String key : parameterMap.keySet()) {
|
||||
String[] val = parameterMap.get(key);
|
||||
if (val != null && val.length > 0) {
|
||||
requestMap.put(key, val[0]); // add the first value only (which is what Spring seems to do)
|
||||
}
|
||||
}
|
||||
requestMap.put(key, val[0]); // add the first value only (which is what Spring seems to do)
|
||||
}
|
||||
}
|
||||
|
||||
return requestMap;
|
||||
}
|
||||
return requestMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.repository.impl;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
|
||||
|
@ -24,8 +26,6 @@ import org.mitre.openid.connect.repository.AddressRepository;
|
|||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
/**
|
||||
* JPA Address repository implementation
|
||||
*
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.repository.impl;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
@ -30,8 +32,6 @@ import org.mitre.openid.connect.repository.BlacklistedSiteRepository;
|
|||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.repository.impl;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.getSingleResult;
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
@ -12,9 +15,6 @@ import org.mitre.openid.connect.repository.PairwiseIdentifierRepository;
|
|||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.getSingleResult;
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.repository.impl;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.getSingleResult;
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
@ -28,9 +31,6 @@ import org.mitre.openid.connect.repository.UserInfoRepository;
|
|||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.getSingleResult;
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
/**
|
||||
* JPA UserInfo repository implementation
|
||||
*
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.repository.impl;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
@ -28,8 +30,6 @@ import org.mitre.util.jpa.JpaUtil;
|
|||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||
|
||||
/**
|
||||
* JPA WhitelistedSite repository implementation
|
||||
*
|
||||
|
|
|
@ -36,7 +36,6 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.oauth2.common.util.OAuth2Utils;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Request;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -130,6 +129,7 @@ public class DefaultOIDCTokenService implements OIDCTokenService {
|
|||
* @return
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
@Override
|
||||
public OAuth2AccessTokenEntity createRegistrationAccessToken(ClientDetailsEntity client) {
|
||||
|
||||
Map<String, String> authorizationParameters = Maps.newHashMap();
|
||||
|
|
|
@ -20,96 +20,96 @@ import com.google.common.collect.SetMultimap;
|
|||
@Service("scopeClaimTranslator")
|
||||
public class DefaultScopeClaimTranslationService implements ScopeClaimTranslationService {
|
||||
|
||||
private SetMultimap<String, String> scopesToClaims = HashMultimap.create();
|
||||
private Map<String, String> claimsToFields = Maps.newHashMap();
|
||||
private SetMultimap<String, String> scopesToClaims = HashMultimap.create();
|
||||
private Map<String, String> claimsToFields = Maps.newHashMap();
|
||||
|
||||
/**
|
||||
* Default constructor; initializes scopesToClaims map
|
||||
*/
|
||||
public DefaultScopeClaimTranslationService() {
|
||||
/**
|
||||
* Default constructor; initializes scopesToClaims map
|
||||
*/
|
||||
public DefaultScopeClaimTranslationService() {
|
||||
|
||||
scopesToClaims.put("openid", "sub");
|
||||
scopesToClaims.put("openid", "sub");
|
||||
|
||||
scopesToClaims.put("profile", "name");
|
||||
scopesToClaims.put("profile", "preferred_username");
|
||||
scopesToClaims.put("profile", "given_name");
|
||||
scopesToClaims.put("profile", "family_name");
|
||||
scopesToClaims.put("profile", "middle_name");
|
||||
scopesToClaims.put("profile", "nickname");
|
||||
scopesToClaims.put("profile", "profile");
|
||||
scopesToClaims.put("profile", "picture");
|
||||
scopesToClaims.put("profile", "website");
|
||||
scopesToClaims.put("profile", "gender");
|
||||
scopesToClaims.put("profile", "zone_info");
|
||||
scopesToClaims.put("profile", "locale");
|
||||
scopesToClaims.put("profile", "updated_time");
|
||||
scopesToClaims.put("profile", "birthdate");
|
||||
scopesToClaims.put("profile", "name");
|
||||
scopesToClaims.put("profile", "preferred_username");
|
||||
scopesToClaims.put("profile", "given_name");
|
||||
scopesToClaims.put("profile", "family_name");
|
||||
scopesToClaims.put("profile", "middle_name");
|
||||
scopesToClaims.put("profile", "nickname");
|
||||
scopesToClaims.put("profile", "profile");
|
||||
scopesToClaims.put("profile", "picture");
|
||||
scopesToClaims.put("profile", "website");
|
||||
scopesToClaims.put("profile", "gender");
|
||||
scopesToClaims.put("profile", "zone_info");
|
||||
scopesToClaims.put("profile", "locale");
|
||||
scopesToClaims.put("profile", "updated_time");
|
||||
scopesToClaims.put("profile", "birthdate");
|
||||
|
||||
scopesToClaims.put("email", "email");
|
||||
scopesToClaims.put("email", "email_verified");
|
||||
scopesToClaims.put("email", "email");
|
||||
scopesToClaims.put("email", "email_verified");
|
||||
|
||||
scopesToClaims.put("phone", "phone_number");
|
||||
scopesToClaims.put("phone", "phone_number_verified");
|
||||
scopesToClaims.put("phone", "phone_number");
|
||||
scopesToClaims.put("phone", "phone_number_verified");
|
||||
|
||||
scopesToClaims.put("address", "address");
|
||||
scopesToClaims.put("address", "address");
|
||||
|
||||
claimsToFields.put("sub", "sub");
|
||||
claimsToFields.put("sub", "sub");
|
||||
|
||||
claimsToFields.put("name", "name");
|
||||
claimsToFields.put("preferred_username", "preferredUsername");
|
||||
claimsToFields.put("given_name", "givenName");
|
||||
claimsToFields.put("family_name", "familyName");
|
||||
claimsToFields.put("middle_name", "middleName");
|
||||
claimsToFields.put("nickname", "nickname");
|
||||
claimsToFields.put("profile", "profile");
|
||||
claimsToFields.put("picture", "picture");
|
||||
claimsToFields.put("website", "website");
|
||||
claimsToFields.put("gender", "gender");
|
||||
claimsToFields.put("zone_info", "zoneinfo");
|
||||
claimsToFields.put("locale", "locale");
|
||||
claimsToFields.put("updated_time", "updatedTime");
|
||||
claimsToFields.put("birthdate", "birthdate");
|
||||
claimsToFields.put("name", "name");
|
||||
claimsToFields.put("preferred_username", "preferredUsername");
|
||||
claimsToFields.put("given_name", "givenName");
|
||||
claimsToFields.put("family_name", "familyName");
|
||||
claimsToFields.put("middle_name", "middleName");
|
||||
claimsToFields.put("nickname", "nickname");
|
||||
claimsToFields.put("profile", "profile");
|
||||
claimsToFields.put("picture", "picture");
|
||||
claimsToFields.put("website", "website");
|
||||
claimsToFields.put("gender", "gender");
|
||||
claimsToFields.put("zone_info", "zoneinfo");
|
||||
claimsToFields.put("locale", "locale");
|
||||
claimsToFields.put("updated_time", "updatedTime");
|
||||
claimsToFields.put("birthdate", "birthdate");
|
||||
|
||||
claimsToFields.put("email", "email");
|
||||
claimsToFields.put("email_verified", "emailVerified");
|
||||
claimsToFields.put("email", "email");
|
||||
claimsToFields.put("email_verified", "emailVerified");
|
||||
|
||||
claimsToFields.put("phone_number", "phoneNumber");
|
||||
claimsToFields.put("phone_number_verified", "phoneNumberVerified");
|
||||
claimsToFields.put("phone_number", "phoneNumber");
|
||||
claimsToFields.put("phone_number_verified", "phoneNumberVerified");
|
||||
|
||||
claimsToFields.put("address", "address");
|
||||
claimsToFields.put("address", "address");
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getClaimsForScope(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getClaimsForScope(String scope) {
|
||||
if (scopesToClaims.containsKey(scope)) {
|
||||
return scopesToClaims.get(scope);
|
||||
} else {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getClaimsForScope(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getClaimsForScope(String scope) {
|
||||
if (scopesToClaims.containsKey(scope)) {
|
||||
return scopesToClaims.get(scope);
|
||||
} else {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getClaimsForScopeSet(java.util.Set)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getClaimsForScopeSet(Set<String> scopes) {
|
||||
Set<String> result = new HashSet<String>();
|
||||
for (String scope : scopes) {
|
||||
result.addAll(getClaimsForScope(scope));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getClaimsForScopeSet(java.util.Set)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getClaimsForScopeSet(Set<String> scopes) {
|
||||
Set<String> result = new HashSet<String>();
|
||||
for (String scope : scopes) {
|
||||
result.addAll(getClaimsForScope(scope));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getFieldNameForClaim(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getFieldNameForClaim(String claim) {
|
||||
return claimsToFields.get(claim);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.openid.connect.service.ScopeClaimTranslationService#getFieldNameForClaim(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getFieldNameForClaim(String claim) {
|
||||
return claimsToFields.get(claim);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package org.mitre.openid.connect.service.impl;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
||||
import org.mitre.openid.connect.model.PairwiseIdentifier;
|
||||
import org.mitre.openid.connect.model.UserInfo;
|
||||
|
@ -35,7 +34,7 @@ public class UUIDPairwiseIdentiferService implements PairwiseIdentiferService {
|
|||
private PairwiseIdentifierRepository pairwiseIdentifierRepository;
|
||||
|
||||
@Override
|
||||
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client) {
|
||||
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client) {
|
||||
|
||||
String sectorIdentifier = null;
|
||||
|
||||
|
@ -68,6 +67,6 @@ public class UUIDPairwiseIdentiferService implements PairwiseIdentiferService {
|
|||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class ConnectTokenEnhancer implements TokenEnhancer {
|
|||
UserInfo userInfo = userInfoService.getByUsernameAndClientId(username, clientId);
|
||||
|
||||
OAuth2AccessTokenEntity idTokenEntity = connectTokenService.createIdToken(client,
|
||||
originalAuthRequest, (java.util.Date) claims.getIssueTime(),
|
||||
originalAuthRequest, claims.getIssueTime(),
|
||||
userInfo.getSub(), signingAlg, token);
|
||||
|
||||
// attach the id token to the parent access token
|
||||
|
|
|
@ -208,7 +208,7 @@ public class TofuUserApprovalHandler implements UserApprovalHandler {
|
|||
if (systemScope.isStructured()){
|
||||
String paramValue = approvalParams.get("scopeparam_" + scope);
|
||||
allowedScopes.add(scope + ":"+paramValue);
|
||||
// .. and if it's unstructured, we're all set
|
||||
// .. and if it's unstructured, we're all set
|
||||
} else {
|
||||
allowedScopes.add(scope);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ import java.io.IOException;
|
|||
import java.io.Writer;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
|
@ -17,12 +17,9 @@
|
|||
package org.mitre.openid.connect.web;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.mitre.jwt.signer.service.JwtSigningAndValidationService;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
||||
import org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod;
|
||||
|
@ -42,7 +39,6 @@ import org.springframework.http.HttpStatus;
|
|||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails;
|
||||
import org.springframework.security.web.util.UrlUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.oauth2.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -38,11 +43,6 @@ import org.springframework.security.oauth2.common.exceptions.InvalidClientExcept
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -43,9 +43,7 @@ import org.mockito.InjectMocks;
|
|||
import org.mockito.Matchers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
|
||||
import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
|
||||
import org.springframework.security.oauth2.common.exceptions.InvalidScopeException;
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.oauth2.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -32,11 +37,6 @@ import org.mockito.stubbing.Answer;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
@ -122,11 +122,11 @@ public class TestDefaultSystemScopeService {
|
|||
// we re-use this value so we've got to use thenAnswer instead
|
||||
Mockito.when(repository.getByValue(structuredScope1String)).thenAnswer(new Answer<SystemScope>() {
|
||||
@Override
|
||||
public SystemScope answer(InvocationOnMock invocation) throws Throwable {
|
||||
public SystemScope answer(InvocationOnMock invocation) throws Throwable {
|
||||
SystemScope s = new SystemScope(structuredScope1String);
|
||||
s.setStructured(true);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
@ -200,11 +200,11 @@ public class TestDefaultSystemScopeService {
|
|||
// note: we have to use "thenAnswer" here to mimic the repository not serializing the structuredValue field
|
||||
Mockito.when(repository.getByValue("foo")).thenAnswer(new Answer<SystemScope>() {
|
||||
@Override
|
||||
public SystemScope answer(InvocationOnMock invocation) throws Throwable {
|
||||
public SystemScope answer(InvocationOnMock invocation) throws Throwable {
|
||||
SystemScope foo = new SystemScope("foo");
|
||||
foo.setStructured(true);
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -34,10 +38,6 @@ import org.springframework.test.annotation.Rollback;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class TestDefaultApprovedSiteService {
|
||||
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -30,10 +34,6 @@ import org.mockito.runners.MockitoJUnitRunner;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -33,9 +36,6 @@ import org.mockito.runners.MockitoJUnitRunner;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -14,15 +17,13 @@ import org.mitre.openid.connect.model.UserInfo;
|
|||
import org.mitre.openid.connect.repository.UserInfoRepository;
|
||||
import org.mitre.openid.connect.service.PairwiseIdentiferService;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Matchers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
@ -171,7 +172,7 @@ public class TestDefaultUserInfoService {
|
|||
|
||||
Mockito.when(userInfoRepository.getByUsername(regularUsername)).thenReturn(userInfoRegular);
|
||||
|
||||
Mockito.verify(pairwiseIdentiferService, Mockito.never()).getIdentifier(Mockito.any(UserInfo.class), Mockito.any(ClientDetailsEntity.class));
|
||||
Mockito.verify(pairwiseIdentiferService, Mockito.never()).getIdentifier(Matchers.any(UserInfo.class), Matchers.any(ClientDetailsEntity.class));
|
||||
|
||||
UserInfo user1 = service.getByUsernameAndClientId(regularUsername, publicClientId1);
|
||||
UserInfo user2 = service.getByUsernameAndClientId(regularUsername, publicClientId2);
|
||||
|
@ -192,13 +193,14 @@ public class TestDefaultUserInfoService {
|
|||
Mockito.when(clientDetailsEntityService.loadClientByClientId(pairwiseClientId4)).thenReturn(pairwiseClient4);
|
||||
|
||||
Mockito.when(userInfoRepository.getByUsername(regularUsername)).thenAnswer(new Answer<UserInfo>() {
|
||||
public UserInfo answer(InvocationOnMock invocation) throws Throwable {
|
||||
UserInfo userInfo = new DefaultUserInfo();
|
||||
userInfo.setPreferredUsername(regularUsername);
|
||||
userInfo.setSub(regularSub);
|
||||
@Override
|
||||
public UserInfo answer(InvocationOnMock invocation) throws Throwable {
|
||||
UserInfo userInfo = new DefaultUserInfo();
|
||||
userInfo.setPreferredUsername(regularUsername);
|
||||
userInfo.setSub(regularSub);
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
return userInfo;
|
||||
}
|
||||
});
|
||||
|
||||
Mockito.when(pairwiseIdentiferService.getIdentifier(userInfoRegular, pairwiseClient1)).thenReturn(pairwiseSub12);
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.hamcrest.core.IsNot.not;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.matchers.JUnitMatchers.hasItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Before;
|
||||
|
@ -34,11 +39,6 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import static org.hamcrest.core.IsNot.not;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.matchers.JUnitMatchers.hasItem;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class TestDefaultUserInfoUserDetailsService {
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -26,11 +31,6 @@ import org.mockito.Mock;
|
|||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* @author wkim
|
||||
*
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
*/
|
||||
package org.mitre.openid.connect.service.impl;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -16,15 +19,13 @@ import org.mitre.openid.connect.model.PairwiseIdentifier;
|
|||
import org.mitre.openid.connect.model.UserInfo;
|
||||
import org.mitre.openid.connect.repository.PairwiseIdentifierRepository;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Matchers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
|
@ -135,7 +136,7 @@ public class TestUUIDPairwiseIdentiferService {
|
|||
public void testGetIdentifier_newEqual() {
|
||||
|
||||
String pairwise1 = service.getIdentifier(userInfoRegular, pairwiseClient1);
|
||||
Mockito.verify(pairwiseIdentifierRepository, Mockito.atLeast(1)).save(Mockito.any(PairwiseIdentifier.class));
|
||||
Mockito.verify(pairwiseIdentifierRepository, Mockito.atLeast(1)).save(Matchers.any(PairwiseIdentifier.class));
|
||||
|
||||
PairwiseIdentifier pairwiseId = new PairwiseIdentifier();
|
||||
pairwiseId.setUserSub(regularSub);
|
||||
|
|
Loading…
Reference in New Issue