automated code formatting and cleanup
parent
e1e7f7a579
commit
ebbc7209aa
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,8 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.oauth2.introspectingfilter;
|
package org.mitre.oauth2.introspectingfilter;
|
||||||
|
|
||||||
|
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Date;
|
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.IntrospectionConfigurationService;
|
||||||
import org.mitre.oauth2.introspectingfilter.service.impl.SimpleIntrospectionAuthorityGranter;
|
import org.mitre.oauth2.introspectingfilter.service.impl.SimpleIntrospectionAuthorityGranter;
|
||||||
import org.mitre.oauth2.model.RegisteredClient;
|
import org.mitre.oauth2.model.RegisteredClient;
|
||||||
import org.mitre.openid.connect.client.service.ClientConfigurationService;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
@ -53,8 +54,6 @@ import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.nimbusds.jose.util.Base64;
|
import com.nimbusds.jose.util.Base64;
|
||||||
|
|
||||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This ResourceServerTokenServices implementation introspects incoming tokens at a
|
* This ResourceServerTokenServices implementation introspects incoming tokens at a
|
||||||
* server's introspection endpoint URL and passes an Authentication object along
|
* server's introspection endpoint URL and passes an Authentication object along
|
||||||
|
@ -63,13 +62,13 @@ import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IntrospectingTokenService implements ResourceServerTokenServices {
|
public class IntrospectingTokenService implements ResourceServerTokenServices {
|
||||||
|
|
||||||
private IntrospectionConfigurationService introspectionConfigurationService;
|
private IntrospectionConfigurationService introspectionConfigurationService;
|
||||||
private IntrospectionAuthorityGranter introspectionAuthorityGranter = new SimpleIntrospectionAuthorityGranter();
|
private IntrospectionAuthorityGranter introspectionAuthorityGranter = new SimpleIntrospectionAuthorityGranter();
|
||||||
|
|
||||||
private DefaultHttpClient httpClient = new DefaultHttpClient();
|
private DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||||
private HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
private HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||||
|
|
||||||
// Inner class to store in the hash map
|
// Inner class to store in the hash map
|
||||||
private class TokenCacheObject {
|
private class TokenCacheObject {
|
||||||
OAuth2AccessToken token;
|
OAuth2AccessToken token;
|
||||||
|
@ -142,14 +141,14 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
|
||||||
|
|
||||||
// find out which URL to ask
|
// find out which URL to ask
|
||||||
String introspectionUrl;
|
String introspectionUrl;
|
||||||
RegisteredClient client;
|
RegisteredClient client;
|
||||||
try {
|
try {
|
||||||
introspectionUrl = introspectionConfigurationService.getIntrospectionUrl(accessToken);
|
introspectionUrl = introspectionConfigurationService.getIntrospectionUrl(accessToken);
|
||||||
client = introspectionConfigurationService.getClientConfiguration(accessToken);
|
client = introspectionConfigurationService.getClientConfiguration(accessToken);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
logger.error("Unable to load introspection URL or client configuration", e);
|
logger.error("Unable to load introspection URL or client configuration", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Use the SpringFramework RestTemplate to send the request to the
|
// Use the SpringFramework RestTemplate to send the request to the
|
||||||
// endpoint
|
// endpoint
|
||||||
String validatedToken = null;
|
String validatedToken = null;
|
||||||
|
@ -159,7 +158,7 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
|
||||||
|
|
||||||
final String clientId = client.getClientId();
|
final String clientId = client.getClientId();
|
||||||
final String clientSecret = client.getClientSecret();
|
final String clientSecret = client.getClientSecret();
|
||||||
|
|
||||||
if (SECRET_BASIC.equals(client.getTokenEndpointAuthMethod())){
|
if (SECRET_BASIC.equals(client.getTokenEndpointAuthMethod())){
|
||||||
// use BASIC auth if configured to do so
|
// use BASIC auth if configured to do so
|
||||||
restTemplate = new RestTemplate(factory) {
|
restTemplate = new RestTemplate(factory) {
|
||||||
|
@ -178,7 +177,7 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
|
||||||
form.add("client_id", clientId);
|
form.add("client_id", clientId);
|
||||||
form.add("client_secret", clientSecret);
|
form.add("client_secret", clientSecret);
|
||||||
}
|
}
|
||||||
|
|
||||||
form.add("token", accessToken);
|
form.add("token", accessToken);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -32,7 +32,6 @@ import org.springframework.security.oauth2.common.OAuth2RefreshToken;
|
||||||
|
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
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");
|
DateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||||
if (token.get("exp") != null) {
|
if (token.get("exp") != null) {
|
||||||
try {
|
try {
|
||||||
expireDate = dateFormater.parse(token.get("exp").getAsString());
|
expireDate = dateFormater.parse(token.get("exp").getAsString());
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
Logger.getLogger(IntrospectingTokenService.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(IntrospectingTokenService.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -34,7 +34,7 @@ public interface IntrospectionConfigurationService {
|
||||||
*/
|
*/
|
||||||
public String getIntrospectionUrl(String accessToken);
|
public String getIntrospectionUrl(String accessToken);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the client configuration to use to connect to the
|
* Get the client configuration to use to connect to the
|
||||||
* introspection endpoint. In particular, this cares about
|
* introspection endpoint. In particular, this cares about
|
||||||
|
@ -42,5 +42,5 @@ public interface IntrospectionConfigurationService {
|
||||||
* fields.
|
* fields.
|
||||||
*/
|
*/
|
||||||
public RegisteredClient getClientConfiguration(String accessToken);
|
public RegisteredClient getClientConfiguration(String accessToken);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -62,17 +62,17 @@ public class JWTParsingIntrospectionConfigurationService implements Introspectio
|
||||||
|
|
||||||
private String getIssuer(String accessToken) {
|
private String getIssuer(String accessToken) {
|
||||||
try {
|
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) {
|
} catch (ParseException e) {
|
||||||
throw new IllegalArgumentException("Unable to parse JWT", e);
|
throw new IllegalArgumentException("Unable to parse JWT", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.oauth2.introspectingfilter.IntrospectionConfigurationService#getIntrospectionUrl(java.lang.String)
|
* @see org.mitre.oauth2.introspectingfilter.IntrospectionConfigurationService#getIntrospectionUrl(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@ -98,28 +98,28 @@ public class JWTParsingIntrospectionConfigurationService implements Introspectio
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||||
|
|
||||||
String issuer = getIssuer(accessToken);
|
String issuer = getIssuer(accessToken);
|
||||||
if (!Strings.isNullOrEmpty(issuer)) {
|
if (!Strings.isNullOrEmpty(issuer)) {
|
||||||
ServerConfiguration server = serverConfigurationService.getServerConfiguration(issuer);
|
ServerConfiguration server = serverConfigurationService.getServerConfiguration(issuer);
|
||||||
if (server != null) {
|
if (server != null) {
|
||||||
RegisteredClient client = clientConfigurationService.getClientConfiguration(server);
|
RegisteredClient client = clientConfigurationService.getClientConfiguration(server);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
return client;
|
return client;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Could not find client configuration for issuer " + issuer);
|
throw new IllegalArgumentException("Could not find client configuration for issuer " + issuer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Could not find server configuration for issuer " + issuer);
|
throw new IllegalArgumentException("Could not find server configuration for issuer " + issuer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("No issuer claim found in JWT");
|
throw new IllegalArgumentException("No issuer claim found in JWT");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -24,7 +24,7 @@ import org.mitre.oauth2.model.RegisteredClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Always provides the (configured) IntrospectionURL and RegisteredClient regardless
|
* Always provides the (configured) IntrospectionURL and RegisteredClient regardless
|
||||||
* of token. Useful for talking to a single, trusted authorization server.
|
* of token. Useful for talking to a single, trusted authorization server.
|
||||||
*
|
*
|
||||||
* @author jricher
|
* @author jricher
|
||||||
|
@ -74,9 +74,9 @@ public class StaticIntrospectionConfigurationService implements IntrospectionCon
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
* @see org.mitre.oauth2.introspectingfilter.service.IntrospectionConfigurationService#getClientConfiguration(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RegisteredClient getClientConfiguration(String accessToken) {
|
public RegisteredClient getClientConfiguration(String accessToken) {
|
||||||
return getClientConfiguration();
|
return getClientConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,8 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client;
|
package org.mitre.openid.connect.client;
|
||||||
|
|
||||||
|
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.SECRET_BASIC;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -63,8 +65,6 @@ import com.nimbusds.jose.util.Base64;
|
||||||
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
||||||
import com.nimbusds.jwt.SignedJWT;
|
import com.nimbusds.jwt.SignedJWT;
|
||||||
|
|
||||||
import static org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenID Connect Authentication Filter class
|
* OpenID Connect Authentication Filter class
|
||||||
*
|
*
|
||||||
|
@ -93,7 +93,7 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
|
||||||
private IssuerService issuerService;
|
private IssuerService issuerService;
|
||||||
private AuthRequestOptionsService authOptions = new StaticAuthRequestOptionsService(); // initialize with an empty set of options
|
private AuthRequestOptionsService authOptions = new StaticAuthRequestOptionsService(); // initialize with an empty set of options
|
||||||
private AuthRequestUrlBuilder authRequestBuilder;
|
private AuthRequestUrlBuilder authRequestBuilder;
|
||||||
|
|
||||||
protected int httpSocketTimeout = HTTP_SOCKET_TIMEOUT;
|
protected int httpSocketTimeout = HTTP_SOCKET_TIMEOUT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,7 +206,7 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
|
||||||
String state = createState(session);
|
String state = createState(session);
|
||||||
|
|
||||||
Map<String, String> options = authOptions.getOptions(serverConfig, clientConfig, request);
|
Map<String, String> options = authOptions.getOptions(serverConfig, clientConfig, request);
|
||||||
|
|
||||||
String authRequest = authRequestBuilder.buildAuthRequestUrl(serverConfig, clientConfig, redirectUri, nonce, state, options);
|
String authRequest = authRequestBuilder.buildAuthRequestUrl(serverConfig, clientConfig, redirectUri, nonce, state, options);
|
||||||
|
|
||||||
logger.debug("Auth Request: " + authRequest);
|
logger.debug("Auth Request: " + authRequest);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -34,30 +34,30 @@ import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class to fetch userinfo from the userinfo endpoint, if available.
|
* Utility class to fetch userinfo from the userinfo endpoint, if available.
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UserInfoFetcher {
|
public class UserInfoFetcher {
|
||||||
|
|
||||||
private Logger logger = LoggerFactory.getLogger(UserInfoFetcher.class);
|
private Logger logger = LoggerFactory.getLogger(UserInfoFetcher.class);
|
||||||
|
|
||||||
public UserInfo loadUserInfo(OIDCAuthenticationToken token) {
|
public UserInfo loadUserInfo(OIDCAuthenticationToken token) {
|
||||||
|
|
||||||
ServerConfiguration serverConfiguration = token.getServerConfiguration();
|
ServerConfiguration serverConfiguration = token.getServerConfiguration();
|
||||||
|
|
||||||
if (serverConfiguration == null) {
|
if (serverConfiguration == null) {
|
||||||
logger.warn("No server configuration found.");
|
logger.warn("No server configuration found.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Strings.isNullOrEmpty(serverConfiguration.getUserInfoUri())) {
|
if (Strings.isNullOrEmpty(serverConfiguration.getUserInfoUri())) {
|
||||||
logger.warn("No userinfo endpoint, not fetching.");
|
logger.warn("No userinfo endpoint, not fetching.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we got this far, try to actually get the userinfo
|
// if we got this far, try to actually get the userinfo
|
||||||
|
|
||||||
HttpClient httpClient = new DefaultHttpClient();
|
HttpClient httpClient = new DefaultHttpClient();
|
||||||
|
|
||||||
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||||
|
@ -69,11 +69,11 @@ public class UserInfoFetcher {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String userInfoString = restTemplate.postForObject(serverConfiguration.getUserInfoUri(), form, String.class);
|
String userInfoString = restTemplate.postForObject(serverConfiguration.getUserInfoUri(), form, String.class);
|
||||||
|
|
||||||
JsonObject userInfoJson = new JsonParser().parse(userInfoString).getAsJsonObject();
|
JsonObject userInfoJson = new JsonParser().parse(userInfoString).getAsJsonObject();
|
||||||
|
|
||||||
UserInfo userInfo = DefaultUserInfo.fromJson(userInfoJson);
|
UserInfo userInfo = DefaultUserInfo.fromJson(userInfoJson);
|
||||||
|
|
||||||
return userInfo;
|
return userInfo;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("Error fetching userinfo", e);
|
logger.warn("Error fetching userinfo", e);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.mitre.openid.connect.config.ServerConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* This service provides any extra options that need to be passed to the authentication request.
|
* This service provides any extra options that need to be passed to the authentication request.
|
||||||
* These options may depend on the server configuration, client configuration, or HTTP request.
|
* These options may depend on the server configuration, client configuration, or HTTP request.
|
||||||
*
|
*
|
||||||
* @author jricher
|
* @author jricher
|
||||||
|
@ -21,5 +21,5 @@ import org.mitre.openid.connect.config.ServerConfiguration;
|
||||||
public interface AuthRequestOptionsService {
|
public interface AuthRequestOptionsService {
|
||||||
|
|
||||||
public Map<String, String> getOptions(ServerConfiguration server, RegisteredClient client, HttpServletRequest request);
|
public Map<String, String> getOptions(ServerConfiguration server, RegisteredClient client, HttpServletRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -165,7 +165,7 @@ public class DynamicRegistrationClientConfigurationService implements ClientConf
|
||||||
private HttpClient httpClient = new DefaultHttpClient();
|
private HttpClient httpClient = new DefaultHttpClient();
|
||||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||||
private Gson gson = new Gson(); // note that this doesn't serialize nulls by default
|
private Gson gson = new Gson(); // note that this doesn't serialize nulls by default
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RegisteredClient load(ServerConfiguration serverConfig) throws Exception {
|
public RegisteredClient load(ServerConfiguration serverConfig) throws Exception {
|
||||||
RestTemplate restTemplate = new RestTemplate(httpFactory);
|
RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -19,6 +19,13 @@
|
||||||
*/
|
*/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
@ -40,8 +47,6 @@ import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
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.
|
* Dynamically fetches OpenID Connect server configurations based on the issuer. Caches the server configurations.
|
||||||
|
@ -150,7 +155,7 @@ public class DynamicServerConfigurationService implements ServerConfigurationSer
|
||||||
|
|
||||||
conf.setIssuer(o.get("issuer").getAsString());
|
conf.setIssuer(o.get("issuer").getAsString());
|
||||||
|
|
||||||
|
|
||||||
conf.setAuthorizationEndpointUri(getAsString(o, "authorization_endpoint"));
|
conf.setAuthorizationEndpointUri(getAsString(o, "authorization_endpoint"));
|
||||||
conf.setTokenEndpointUri(getAsString(o, "token_endpoint"));
|
conf.setTokenEndpointUri(getAsString(o, "token_endpoint"));
|
||||||
conf.setJwksUri(getAsString(o, "jwks_uri"));
|
conf.setJwksUri(getAsString(o, "jwks_uri"));
|
||||||
|
|
|
@ -27,13 +27,13 @@ import com.nimbusds.jwt.JWTClaimsSet;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EncryptedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
public class EncryptedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
||||||
|
|
||||||
private JWKSetCacheService encrypterService;
|
private JWKSetCacheService encrypterService;
|
||||||
|
|
||||||
private JWEAlgorithm alg;
|
private JWEAlgorithm alg;
|
||||||
private EncryptionMethod enc;
|
private EncryptionMethod enc;
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.openid.connect.client.service.AuthRequestUrlBuilder#buildAuthRequestUrl(org.mitre.openid.connect.config.ServerConfiguration, org.mitre.oauth2.model.RegisteredClient, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
|
* @see org.mitre.openid.connect.client.service.AuthRequestUrlBuilder#buildAuthRequestUrl(org.mitre.openid.connect.config.ServerConfiguration, org.mitre.oauth2.model.RegisteredClient, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
|
||||||
*/
|
*/
|
||||||
|
@ -56,18 +56,18 @@ public class EncryptedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
||||||
|
|
||||||
// this comes back in the auth request return
|
// this comes back in the auth request return
|
||||||
claims.setClaim("state", state);
|
claims.setClaim("state", state);
|
||||||
|
|
||||||
// Optional parameters
|
// Optional parameters
|
||||||
for (Entry<String, String> option : options.entrySet()) {
|
for (Entry<String, String> option : options.entrySet()) {
|
||||||
claims.setClaim(option.getKey(), option.getValue());
|
claims.setClaim(option.getKey(), option.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
EncryptedJWT jwt = new EncryptedJWT(new JWEHeader(alg, enc), claims);
|
EncryptedJWT jwt = new EncryptedJWT(new JWEHeader(alg, enc), claims);
|
||||||
|
|
||||||
JwtEncryptionAndDecryptionService encryptor = encrypterService.getEncrypter(serverConfig.getJwksUri());
|
JwtEncryptionAndDecryptionService encryptor = encrypterService.getEncrypter(serverConfig.getJwksUri());
|
||||||
|
|
||||||
encryptor.encryptJwt(jwt);
|
encryptor.encryptJwt(jwt);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
|
URIBuilder uriBuilder = new URIBuilder(serverConfig.getAuthorizationEndpointUri());
|
||||||
uriBuilder.addParameter("request", jwt.serialize());
|
uriBuilder.addParameter("request", jwt.serialize());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -13,7 +13,7 @@ import com.google.common.collect.Sets;
|
||||||
*
|
*
|
||||||
* Issuer service that tries to parse input from the inputs from a third-party
|
* Issuer service that tries to parse input from the inputs from a third-party
|
||||||
* account chooser service (if possible), but falls back to webfinger discovery
|
* account chooser service (if possible), but falls back to webfinger discovery
|
||||||
* if not.
|
* if not.
|
||||||
*
|
*
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
|
@ -22,10 +22,10 @@ public class HybridIssuerService implements IssuerService {
|
||||||
|
|
||||||
private ThirdPartyIssuerService thirdPartyIssuerService = new ThirdPartyIssuerService();
|
private ThirdPartyIssuerService thirdPartyIssuerService = new ThirdPartyIssuerService();
|
||||||
private WebfingerIssuerService webfingerIssuerService = new WebfingerIssuerService();
|
private WebfingerIssuerService webfingerIssuerService = new WebfingerIssuerService();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IssuerServiceResponse getIssuer(HttpServletRequest request) {
|
public IssuerServiceResponse getIssuer(HttpServletRequest request) {
|
||||||
|
|
||||||
IssuerServiceResponse resp = thirdPartyIssuerService.getIssuer(request);
|
IssuerServiceResponse resp = thirdPartyIssuerService.getIssuer(request);
|
||||||
if (resp.shouldRedirect()) {
|
if (resp.shouldRedirect()) {
|
||||||
// if it wants us to redirect, try the webfinger approach first
|
// if it wants us to redirect, try the webfinger approach first
|
||||||
|
@ -33,9 +33,9 @@ public class HybridIssuerService implements IssuerService {
|
||||||
} else {
|
} else {
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getWhitelist() {
|
public Set<String> getWhitelist() {
|
||||||
return Sets.union(thirdPartyIssuerService.getWhitelist(), webfingerIssuerService.getWhitelist());
|
return Sets.union(thirdPartyIssuerService.getWhitelist(), webfingerIssuerService.getWhitelist());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -60,8 +60,8 @@ public class PlainAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
||||||
|
|
||||||
// Optional parameters:
|
// Optional parameters:
|
||||||
for (Entry<String, String> option : options.entrySet()) {
|
for (Entry<String, String> option : options.entrySet()) {
|
||||||
uriBuilder.addParameter(option.getKey(), option.getValue());
|
uriBuilder.addParameter(option.getKey(), option.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
return uriBuilder.build().toString();
|
return uriBuilder.build().toString();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -65,13 +65,13 @@ public class SignedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
|
||||||
|
|
||||||
// this comes back in the auth request return
|
// this comes back in the auth request return
|
||||||
claims.setClaim("state", state);
|
claims.setClaim("state", state);
|
||||||
|
|
||||||
// Optional parameters
|
// Optional parameters
|
||||||
for (Entry<String, String> option : options.entrySet()) {
|
for (Entry<String, String> option : options.entrySet()) {
|
||||||
claims.setClaim(option.getKey(), option.getValue());
|
claims.setClaim(option.getKey(), option.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SignedJWT jwt = new SignedJWT(new JWSHeader(signingAndValidationService.getDefaultSigningAlgorithm()), claims);
|
SignedJWT jwt = new SignedJWT(new JWSHeader(signingAndValidationService.getDefaultSigningAlgorithm()), claims);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.mitre.openid.connect.config.ServerConfiguration;
|
||||||
public class StaticAuthRequestOptionsService implements AuthRequestOptionsService {
|
public class StaticAuthRequestOptionsService implements AuthRequestOptionsService {
|
||||||
|
|
||||||
private Map<String, String> options = new HashMap<String, String>();
|
private Map<String, String> options = new HashMap<String, String>();
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.openid.connect.client.service.AuthRequestOptionsService#getOptions(org.mitre.openid.connect.config.ServerConfiguration, org.mitre.oauth2.model.RegisteredClient, javax.servlet.http.HttpServletRequest)
|
* @see org.mitre.openid.connect.client.service.AuthRequestOptionsService#getOptions(org.mitre.openid.connect.config.ServerConfiguration, org.mitre.oauth2.model.RegisteredClient, javax.servlet.http.HttpServletRequest)
|
||||||
*/
|
*/
|
||||||
|
@ -45,6 +45,6 @@ public class StaticAuthRequestOptionsService implements AuthRequestOptionsServic
|
||||||
this.options = options;
|
this.options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,11 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -27,11 +32,6 @@ import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -17,6 +17,11 @@
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -27,11 +32,6 @@ import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,7 +16,9 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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 java.util.Map;
|
||||||
|
|
||||||
import org.junit.Before;
|
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.ImmutableMap;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wkim
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
@ -66,7 +65,7 @@ public class TestPlainAuthRequestUrlBuilder {
|
||||||
"&nonce=34fasf3ds" +
|
"&nonce=34fasf3ds" +
|
||||||
"&state=af0ifjsldkj" +
|
"&state=af0ifjsldkj" +
|
||||||
"&foo=bar";
|
"&foo=bar";
|
||||||
|
|
||||||
Map<String, String> options = ImmutableMap.of("foo", "bar");
|
Map<String, String> options = ImmutableMap.of("foo", "bar");
|
||||||
|
|
||||||
String actualUrl = urlBuilder.buildAuthRequestUrl(serverConfig, clientConfig, "https://client.example.org/", "34fasf3ds", "af0ifjsldkj", options);
|
String actualUrl = urlBuilder.buildAuthRequestUrl(serverConfig, clientConfig, "https://client.example.org/", "34fasf3ds", "af0ifjsldkj", options);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,10 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
@ -46,10 +50,6 @@ import com.nimbusds.jose.util.Base64URL;
|
||||||
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
|
||||||
import com.nimbusds.jwt.SignedJWT;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
@ -148,8 +148,8 @@ public class TestSignedAuthRequestUrlBuilder {
|
||||||
assertEquals(nonce, claims.getClaim("nonce"));
|
assertEquals(nonce, claims.getClaim("nonce"));
|
||||||
assertEquals(state, claims.getClaim("state"));
|
assertEquals(state, claims.getClaim("state"));
|
||||||
for (String claim : options.keySet()) {
|
for (String claim : options.keySet()) {
|
||||||
assertEquals(options.get(claim), claims.getClaim(claim));
|
assertEquals(options.get(claim), claims.getClaim(claim));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = AuthenticationServiceException.class)
|
@Test(expected = AuthenticationServiceException.class)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,12 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -28,12 +34,6 @@ import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,12 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -26,12 +32,6 @@ import org.mitre.openid.connect.config.ServerConfiguration;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,6 +16,10 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.openid.connect.client.service.impl;
|
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 javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -26,10 +30,6 @@ import org.springframework.security.authentication.AuthenticationServiceExceptio
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
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
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.nimbusds.jose.JWSAlgorithm;
|
||||||
public class JsonUtils {
|
public class JsonUtils {
|
||||||
|
|
||||||
private static Gson gson = new Gson();
|
private static Gson gson = new Gson();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate a set of strings to a JSON array
|
* Translate a set of strings to a JSON array
|
||||||
* @param value
|
* @param value
|
||||||
|
@ -119,7 +119,7 @@ public class JsonUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the given given member as a set of strings, null if it doesn't exist
|
* Gets the value of the given given member as a set of strings, null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -130,7 +130,7 @@ public class JsonUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the given given member as a set of strings, null if it doesn't exist
|
* Gets the value of the given given member as a set of strings, null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -141,7 +141,7 @@ public class JsonUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -150,14 +150,14 @@ public class JsonUtils {
|
||||||
if (strings != null) {
|
if (strings != null) {
|
||||||
List<JWSAlgorithm> algs = new ArrayList<JWSAlgorithm>();
|
List<JWSAlgorithm> algs = new ArrayList<JWSAlgorithm>();
|
||||||
for (String alg : strings) {
|
for (String alg : strings) {
|
||||||
algs.add(JWSAlgorithm.parse(alg));
|
algs.add(JWSAlgorithm.parse(alg));
|
||||||
}
|
}
|
||||||
return algs;
|
return algs;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -166,14 +166,14 @@ public class JsonUtils {
|
||||||
if (strings != null) {
|
if (strings != null) {
|
||||||
List<JWEAlgorithm> algs = new ArrayList<JWEAlgorithm>();
|
List<JWEAlgorithm> algs = new ArrayList<JWEAlgorithm>();
|
||||||
for (String alg : strings) {
|
for (String alg : strings) {
|
||||||
algs.add(JWEAlgorithm.parse(alg));
|
algs.add(JWEAlgorithm.parse(alg));
|
||||||
}
|
}
|
||||||
return algs;
|
return algs;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
* Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
||||||
*/
|
*/
|
||||||
|
@ -182,12 +182,12 @@ public class JsonUtils {
|
||||||
if (strings != null) {
|
if (strings != null) {
|
||||||
List<EncryptionMethod> algs = new ArrayList<EncryptionMethod>();
|
List<EncryptionMethod> algs = new ArrayList<EncryptionMethod>();
|
||||||
for (String alg : strings) {
|
for (String alg : strings) {
|
||||||
algs.add(EncryptionMethod.parse(alg));
|
algs.add(EncryptionMethod.parse(alg));
|
||||||
}
|
}
|
||||||
return algs;
|
return algs;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -58,15 +58,15 @@ public class JWKSetKeyStore {
|
||||||
if (location.exists() && location.isReadable()) {
|
if (location.exists() && location.isReadable()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// read in the file from disk
|
// read in the file from disk
|
||||||
String s = CharStreams.toString(new InputStreamReader(location.getInputStream(), Charsets.UTF_8));
|
String s = CharStreams.toString(new InputStreamReader(location.getInputStream(), Charsets.UTF_8));
|
||||||
|
|
||||||
// parse it into a jwkSet object
|
// parse it into a jwkSet object
|
||||||
jwkSet = JWKSet.parse(s);
|
jwkSet = JWKSet.parse(s);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new IllegalArgumentException("Key Set resource could not be parsed: " + location); }
|
throw new IllegalArgumentException("Key Set resource could not be parsed: " + location); }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
throw new IllegalArgumentException("Key Set resource could not be read: " + location);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -31,38 +31,38 @@ import com.nimbusds.jose.jwk.JWK;
|
||||||
public interface JwtEncryptionAndDecryptionService {
|
public interface JwtEncryptionAndDecryptionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypts the JWT in place with the default encrypter.
|
* Encrypts the JWT in place with the default encrypter.
|
||||||
* If an arbitrary payload is used, then pass in a JWEObject.
|
* If an arbitrary payload is used, then pass in a JWEObject.
|
||||||
* Otherwise, if JWT claims are the payload, then use the JWEObject subclass EncryptedJWT instead.
|
* Otherwise, if JWT claims are the payload, then use the JWEObject subclass EncryptedJWT instead.
|
||||||
* @param jwt
|
* @param jwt
|
||||||
*/
|
*/
|
||||||
public void encryptJwt(JWEObject jwt);
|
public void encryptJwt(JWEObject jwt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decrypts the JWT in place with the default decrypter.
|
* Decrypts the JWT in place with the default decrypter.
|
||||||
* If an arbitrary payload is used, then pass in a JWEObject.
|
* If an arbitrary payload is used, then pass in a JWEObject.
|
||||||
* Otherwise, if JWT claims are the payload, then use the JWEObject subclass EncryptedJWT instead.
|
* Otherwise, if JWT claims are the payload, then use the JWEObject subclass EncryptedJWT instead.
|
||||||
* @param jwt
|
* @param jwt
|
||||||
*/
|
*/
|
||||||
public void decryptJwt(JWEObject jwt);
|
public void decryptJwt(JWEObject jwt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all public keys for this service, mapped by their Key ID
|
* Get all public keys for this service, mapped by their Key ID
|
||||||
*/
|
*/
|
||||||
public Map<String, JWK> getAllPublicKeys();
|
public Map<String, JWK> getAllPublicKeys();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of all encryption algorithms supported by this service.
|
* Get the list of all encryption algorithms supported by this service.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Collection<JWEAlgorithm> getAllEncryptionAlgsSupported();
|
public Collection<JWEAlgorithm> getAllEncryptionAlgsSupported();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of all encryption methods supported by this service.
|
* Get the list of all encryption methods supported by this service.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Collection<EncryptionMethod> getAllEncryptionEncsSupported();
|
public Collection<EncryptionMethod> getAllEncryptionEncsSupported();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO add functionality for encrypting and decrypting using a specified key id.
|
* TODO add functionality for encrypting and decrypting using a specified key id.
|
||||||
* Example: public void encryptJwt(EncryptedJWT jwt, String kid);
|
* Example: public void encryptJwt(EncryptedJWT jwt, String kid);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -61,7 +61,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
private Map<String, JWEDecrypter> decrypters = new HashMap<String, JWEDecrypter>();
|
private Map<String, JWEDecrypter> decrypters = new HashMap<String, JWEDecrypter>();
|
||||||
|
|
||||||
private String defaultEncryptionKeyId;
|
private String defaultEncryptionKeyId;
|
||||||
|
|
||||||
private String defaultDecryptionKeyId;
|
private String defaultDecryptionKeyId;
|
||||||
|
|
||||||
private JWEAlgorithm defaultAlgorithm;
|
private JWEAlgorithm defaultAlgorithm;
|
||||||
|
@ -70,7 +70,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
private Map<String, JWK> keys = new HashMap<String, JWK>();
|
private Map<String, JWK> keys = new HashMap<String, JWK>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build this service based on the keys given. All public keys will be used to make encrypters,
|
* Build this service based on the keys given. All public keys will be used to make encrypters,
|
||||||
* all private keys will be used to make decrypters.
|
* all private keys will be used to make decrypters.
|
||||||
*
|
*
|
||||||
* @param keys
|
* @param keys
|
||||||
|
@ -82,7 +82,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
this.keys = keys;
|
this.keys = keys;
|
||||||
buildEncryptersAndDecrypters();
|
buildEncryptersAndDecrypters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build this service based on the given keystore. All keys must have a key
|
* Build this service based on the given keystore. All keys must have a key
|
||||||
* id ({@code kid}) field in order to be used.
|
* id ({@code kid}) field in order to be used.
|
||||||
|
@ -93,7 +93,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
* @throws JOSEException
|
* @throws JOSEException
|
||||||
*/
|
*/
|
||||||
public DefaultJwtEncryptionAndDecryptionService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
public DefaultJwtEncryptionAndDecryptionService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
||||||
|
|
||||||
// convert all keys in the keystore to a map based on key id
|
// convert all keys in the keystore to a map based on key id
|
||||||
for (JWK key : keyStore.getKeys()) {
|
for (JWK key : keyStore.getKeys()) {
|
||||||
if (!Strings.isNullOrEmpty(key.getKeyID())) {
|
if (!Strings.isNullOrEmpty(key.getKeyID())) {
|
||||||
|
@ -102,11 +102,11 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
|
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildEncryptersAndDecrypters();
|
buildEncryptersAndDecrypters();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{
|
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{
|
||||||
|
@ -169,7 +169,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
try {
|
try {
|
||||||
jwt.encrypt(encrypter);
|
jwt.encrypt(encrypter);
|
||||||
} catch (JOSEException e) {
|
} catch (JOSEException e) {
|
||||||
|
|
||||||
logger.error("Failed to encrypt JWT, error was: ", e);
|
logger.error("Failed to encrypt JWT, error was: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
try {
|
try {
|
||||||
jwt.decrypt(decrypter);
|
jwt.decrypt(decrypter);
|
||||||
} catch (JOSEException e) {
|
} catch (JOSEException e) {
|
||||||
|
|
||||||
logger.error("Failed to decrypt JWT, error was: ", e);
|
logger.error("Failed to decrypt JWT, error was: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,10 +197,10 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds all the encrypters and decrypters for this service based on the key map.
|
* Builds all the encrypters and decrypters for this service based on the key map.
|
||||||
* @throws
|
* @throws
|
||||||
* @throws InvalidKeySpecException
|
* @throws InvalidKeySpecException
|
||||||
* @throws NoSuchAlgorithmException
|
* @throws NoSuchAlgorithmException
|
||||||
* @throws JOSEException
|
* @throws JOSEException
|
||||||
*/
|
*/
|
||||||
private void buildEncryptersAndDecrypters() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
private void buildEncryptersAndDecrypters() throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
|
|
||||||
DirectEncrypter encrypter = new DirectEncrypter(((OctetSequenceKey) jwk).toByteArray());
|
DirectEncrypter encrypter = new DirectEncrypter(((OctetSequenceKey) jwk).toByteArray());
|
||||||
DirectDecrypter decrypter = new DirectDecrypter(((OctetSequenceKey) jwk).toByteArray());
|
DirectDecrypter decrypter = new DirectDecrypter(((OctetSequenceKey) jwk).toByteArray());
|
||||||
|
|
||||||
encrypters.put(id, encrypter);
|
encrypters.put(id, encrypter);
|
||||||
decrypters.put(id, decrypter);
|
decrypters.put(id, decrypter);
|
||||||
|
|
||||||
|
@ -274,20 +274,20 @@ public class DefaultJwtEncryptionAndDecryptionService implements JwtEncryptionAn
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.jwt.encryption.service.JwtEncryptionAndDecryptionService#getAllEncryptionEncsSupported()
|
* @see org.mitre.jwt.encryption.service.JwtEncryptionAndDecryptionService#getAllEncryptionEncsSupported()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Collection<EncryptionMethod> getAllEncryptionEncsSupported() {
|
public Collection<EncryptionMethod> getAllEncryptionEncsSupported() {
|
||||||
Set<EncryptionMethod> encs = new HashSet<EncryptionMethod>();
|
Set<EncryptionMethod> encs = new HashSet<EncryptionMethod>();
|
||||||
|
|
||||||
for (JWEEncrypter encrypter : encrypters.values()) {
|
for (JWEEncrypter encrypter : encrypters.values()) {
|
||||||
encs.addAll(encrypter.supportedEncryptionMethods());
|
encs.addAll(encrypter.supportedEncryptionMethods());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (JWEDecrypter decrypter : decrypters.values()) {
|
for (JWEDecrypter decrypter : decrypters.values()) {
|
||||||
encs.addAll(decrypter.supportedEncryptionMethods());
|
encs.addAll(decrypter.supportedEncryptionMethods());
|
||||||
}
|
}
|
||||||
|
|
||||||
return encs;
|
return encs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
||||||
|
|
||||||
// map of identifier to key
|
// map of identifier to key
|
||||||
private Map<String, JWK> keys = new HashMap<String, JWK>();
|
private Map<String, JWK> keys = new HashMap<String, JWK>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build this service based on the keys given. All public keys will be used
|
* Build this service based on the keys given. All public keys will be used
|
||||||
* to make verifiers, all private keys will be used to make signers.
|
* to make verifiers, all private keys will be used to make signers.
|
||||||
|
@ -215,29 +215,29 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
||||||
public void signJwt(SignedJWT jwt, JWSAlgorithm alg) {
|
public void signJwt(SignedJWT jwt, JWSAlgorithm alg) {
|
||||||
|
|
||||||
JWSSigner signer = null;
|
JWSSigner signer = null;
|
||||||
|
|
||||||
for (JWSSigner s : signers.values()) {
|
for (JWSSigner s : signers.values()) {
|
||||||
if (s.supportedAlgorithms().contains(alg)) {
|
if (s.supportedAlgorithms().contains(alg)) {
|
||||||
signer = s;
|
signer = s;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signer == null) {
|
if (signer == null) {
|
||||||
//If we can't find an algorithm that matches, we can't sign
|
//If we can't find an algorithm that matches, we can't sign
|
||||||
logger.error("No matching algirthm found for alg=" + alg);
|
logger.error("No matching algirthm found for alg=" + alg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jwt.sign(signer);
|
jwt.sign(signer);
|
||||||
} catch (JOSEException e) {
|
} catch (JOSEException e) {
|
||||||
|
|
||||||
logger.error("Failed to sign JWT, error was: ", e);
|
logger.error("Failed to sign JWT, error was: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean validateSignature(SignedJWT jwt) {
|
public boolean validateSignature(SignedJWT jwt) {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -54,7 +54,7 @@ public class JWKSetCacheService {
|
||||||
|
|
||||||
// map of jwk set uri -> signing/validation service built on the keys found in that jwk set
|
// map of jwk set uri -> signing/validation service built on the keys found in that jwk set
|
||||||
private LoadingCache<String, JwtSigningAndValidationService> validators;
|
private LoadingCache<String, JwtSigningAndValidationService> validators;
|
||||||
|
|
||||||
// map of jwk set uri -> encryption/decryption service built on the keys found in that jwk set
|
// map of jwk set uri -> encryption/decryption service built on the keys found in that jwk set
|
||||||
private LoadingCache<String, JwtEncryptionAndDecryptionService> encrypters;
|
private LoadingCache<String, JwtEncryptionAndDecryptionService> encrypters;
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class JWKSetCacheService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
|
@ -122,27 +122,27 @@ public class JWKSetCacheService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
private class JWKSetEncryptorFetcher extends CacheLoader<String, JwtEncryptionAndDecryptionService> {
|
||||||
private HttpClient httpClient = new DefaultHttpClient();
|
private HttpClient httpClient = new DefaultHttpClient();
|
||||||
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
private HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||||
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
private RestTemplate restTemplate = new RestTemplate(httpFactory);
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.google.common.cache.CacheLoader#load(java.lang.Object)
|
* @see com.google.common.cache.CacheLoader#load(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public JwtEncryptionAndDecryptionService load(String key) throws Exception {
|
public JwtEncryptionAndDecryptionService load(String key) throws Exception {
|
||||||
String jsonString = restTemplate.getForObject(key, String.class);
|
String jsonString = restTemplate.getForObject(key, String.class);
|
||||||
JWKSet jwkSet = JWKSet.parse(jsonString);
|
JWKSet jwkSet = JWKSet.parse(jsonString);
|
||||||
|
|
||||||
JWKSetKeyStore keyStore = new JWKSetKeyStore(jwkSet);
|
JWKSetKeyStore keyStore = new JWKSetKeyStore(jwkSet);
|
||||||
|
|
||||||
JwtEncryptionAndDecryptionService service = new DefaultJwtEncryptionAndDecryptionService(keyStore);
|
JwtEncryptionAndDecryptionService service = new DefaultJwtEncryptionAndDecryptionService(keyStore);
|
||||||
|
|
||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -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;
|
private static final long serialVersionUID = -1617727085733786296L;
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ public class ClientDetailsEntity implements ClientDetails {
|
||||||
private JWSAlgorithmEmbed idTokenSignedResponseAlg = null; // id_token_signed_response_alg
|
private JWSAlgorithmEmbed idTokenSignedResponseAlg = null; // id_token_signed_response_alg
|
||||||
private JWEAlgorithmEmbed idTokenEncryptedResponseAlg = null; // id_token_encrypted_response_alg
|
private JWEAlgorithmEmbed idTokenEncryptedResponseAlg = null; // id_token_encrypted_response_alg
|
||||||
private JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc = null; // id_token_encrypted_response_enc
|
private JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc = null; // id_token_encrypted_response_enc
|
||||||
|
|
||||||
private JWSAlgorithmEmbed tokenEndpointAuthSigningAlg = null; // token_endpoint_auth_signing_alg
|
private JWSAlgorithmEmbed tokenEndpointAuthSigningAlg = null; // token_endpoint_auth_signing_alg
|
||||||
|
|
||||||
private Integer defaultMaxAge; // default_max_age
|
private Integer defaultMaxAge; // default_max_age
|
||||||
|
@ -233,8 +233,8 @@ public class ClientDetailsEntity implements ClientDetails {
|
||||||
if (getIdTokenValiditySeconds() == null) {
|
if (getIdTokenValiditySeconds() == null) {
|
||||||
setIdTokenValiditySeconds(DEFAULT_ID_TOKEN_VALIDITY_SECONDS);
|
setIdTokenValiditySeconds(DEFAULT_ID_TOKEN_VALIDITY_SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the id
|
* @return the id
|
||||||
*/
|
*/
|
||||||
|
@ -781,11 +781,11 @@ public class ClientDetailsEntity implements ClientDetails {
|
||||||
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
||||||
return tokenEndpointAuthSigningAlg;
|
return tokenEndpointAuthSigningAlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
||||||
this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlgEmbed;
|
this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlgEmbed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Transient passthrough methods for JOSE elements
|
// Transient passthrough methods for JOSE elements
|
||||||
//
|
//
|
||||||
|
@ -880,7 +880,7 @@ public class ClientDetailsEntity implements ClientDetails {
|
||||||
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
||||||
this.idTokenEncryptedResponseEnc = new JWEEncryptionMethodEmbed(idTokenEncryptedResponseEnc);
|
this.idTokenEncryptedResponseEnc = new JWEEncryptionMethodEmbed(idTokenEncryptedResponseEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
||||||
if (tokenEndpointAuthSigningAlg != null) {
|
if (tokenEndpointAuthSigningAlg != null) {
|
||||||
|
@ -889,11 +889,11 @@ public class ClientDetailsEntity implements ClientDetails {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
||||||
this.tokenEndpointAuthSigningAlg = new JWSAlgorithmEmbed(tokenEndpointAuthSigningAlg);
|
this.tokenEndpointAuthSigningAlg = new JWSAlgorithmEmbed(tokenEndpointAuthSigningAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// END Transient JOSE methods
|
// END Transient JOSE methods
|
||||||
|
|
||||||
@Basic
|
@Basic
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -579,257 +579,257 @@ public class RegisteredClient {
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithmEmbed getRequestObjectSigningAlgEmbed() {
|
public JWSAlgorithmEmbed getRequestObjectSigningAlgEmbed() {
|
||||||
return client.getRequestObjectSigningAlgEmbed();
|
return client.getRequestObjectSigningAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param requestObjectSigningAlg
|
* @param requestObjectSigningAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setRequestObjectSigningAlgEmbed(JWSAlgorithmEmbed requestObjectSigningAlg) {
|
public void setRequestObjectSigningAlgEmbed(JWSAlgorithmEmbed requestObjectSigningAlg) {
|
||||||
client.setRequestObjectSigningAlgEmbed(requestObjectSigningAlg);
|
client.setRequestObjectSigningAlgEmbed(requestObjectSigningAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithmEmbed getUserInfoSignedResponseAlgEmbed() {
|
public JWSAlgorithmEmbed getUserInfoSignedResponseAlgEmbed() {
|
||||||
return client.getUserInfoSignedResponseAlgEmbed();
|
return client.getUserInfoSignedResponseAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoSignedResponseAlg
|
* @param userInfoSignedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoSignedResponseAlgEmbed(JWSAlgorithmEmbed userInfoSignedResponseAlg) {
|
public void setUserInfoSignedResponseAlgEmbed(JWSAlgorithmEmbed userInfoSignedResponseAlg) {
|
||||||
client.setUserInfoSignedResponseAlgEmbed(userInfoSignedResponseAlg);
|
client.setUserInfoSignedResponseAlgEmbed(userInfoSignedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWEAlgorithmEmbed getUserInfoEncryptedResponseAlgEmbed() {
|
public JWEAlgorithmEmbed getUserInfoEncryptedResponseAlgEmbed() {
|
||||||
return client.getUserInfoEncryptedResponseAlgEmbed();
|
return client.getUserInfoEncryptedResponseAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoEncryptedResponseAlg
|
* @param userInfoEncryptedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoEncryptedResponseAlgEmbed(JWEAlgorithmEmbed userInfoEncryptedResponseAlg) {
|
public void setUserInfoEncryptedResponseAlgEmbed(JWEAlgorithmEmbed userInfoEncryptedResponseAlg) {
|
||||||
client.setUserInfoEncryptedResponseAlgEmbed(userInfoEncryptedResponseAlg);
|
client.setUserInfoEncryptedResponseAlgEmbed(userInfoEncryptedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEncEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEncEmbed()
|
||||||
*/
|
*/
|
||||||
public JWEEncryptionMethodEmbed getUserInfoEncryptedResponseEncEmbed() {
|
public JWEEncryptionMethodEmbed getUserInfoEncryptedResponseEncEmbed() {
|
||||||
return client.getUserInfoEncryptedResponseEncEmbed();
|
return client.getUserInfoEncryptedResponseEncEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoEncryptedResponseEnc
|
* @param userInfoEncryptedResponseEnc
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed userInfoEncryptedResponseEnc) {
|
public void setUserInfoEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed userInfoEncryptedResponseEnc) {
|
||||||
client.setUserInfoEncryptedResponseEncEmbed(userInfoEncryptedResponseEnc);
|
client.setUserInfoEncryptedResponseEncEmbed(userInfoEncryptedResponseEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithmEmbed getIdTokenSignedResponseAlgEmbed() {
|
public JWSAlgorithmEmbed getIdTokenSignedResponseAlgEmbed() {
|
||||||
return client.getIdTokenSignedResponseAlgEmbed();
|
return client.getIdTokenSignedResponseAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenSignedResponseAlg
|
* @param idTokenSignedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenSignedResponseAlgEmbed(JWSAlgorithmEmbed idTokenSignedResponseAlg) {
|
public void setIdTokenSignedResponseAlgEmbed(JWSAlgorithmEmbed idTokenSignedResponseAlg) {
|
||||||
client.setIdTokenSignedResponseAlgEmbed(idTokenSignedResponseAlg);
|
client.setIdTokenSignedResponseAlgEmbed(idTokenSignedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWEAlgorithmEmbed getIdTokenEncryptedResponseAlgEmbed() {
|
public JWEAlgorithmEmbed getIdTokenEncryptedResponseAlgEmbed() {
|
||||||
return client.getIdTokenEncryptedResponseAlgEmbed();
|
return client.getIdTokenEncryptedResponseAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenEncryptedResponseAlg
|
* @param idTokenEncryptedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlgEmbed(org.mitre.jose.JWEAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenEncryptedResponseAlgEmbed(JWEAlgorithmEmbed idTokenEncryptedResponseAlg) {
|
public void setIdTokenEncryptedResponseAlgEmbed(JWEAlgorithmEmbed idTokenEncryptedResponseAlg) {
|
||||||
client.setIdTokenEncryptedResponseAlgEmbed(idTokenEncryptedResponseAlg);
|
client.setIdTokenEncryptedResponseAlgEmbed(idTokenEncryptedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEncEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEncEmbed()
|
||||||
*/
|
*/
|
||||||
public JWEEncryptionMethodEmbed getIdTokenEncryptedResponseEncEmbed() {
|
public JWEEncryptionMethodEmbed getIdTokenEncryptedResponseEncEmbed() {
|
||||||
return client.getIdTokenEncryptedResponseEncEmbed();
|
return client.getIdTokenEncryptedResponseEncEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenEncryptedResponseEnc
|
* @param idTokenEncryptedResponseEnc
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEncEmbed(org.mitre.jose.JWEEncryptionMethodEmbed)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc) {
|
public void setIdTokenEncryptedResponseEncEmbed(JWEEncryptionMethodEmbed idTokenEncryptedResponseEnc) {
|
||||||
client.setIdTokenEncryptedResponseEncEmbed(idTokenEncryptedResponseEnc);
|
client.setIdTokenEncryptedResponseEncEmbed(idTokenEncryptedResponseEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getRequestObjectSigningAlg()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithm getRequestObjectSigningAlg() {
|
public JWSAlgorithm getRequestObjectSigningAlg() {
|
||||||
return client.getRequestObjectSigningAlg();
|
return client.getRequestObjectSigningAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param requestObjectSigningAlg
|
* @param requestObjectSigningAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setRequestObjectSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setRequestObjectSigningAlg(JWSAlgorithm requestObjectSigningAlg) {
|
public void setRequestObjectSigningAlg(JWSAlgorithm requestObjectSigningAlg) {
|
||||||
client.setRequestObjectSigningAlg(requestObjectSigningAlg);
|
client.setRequestObjectSigningAlg(requestObjectSigningAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoSignedResponseAlg()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithm getUserInfoSignedResponseAlg() {
|
public JWSAlgorithm getUserInfoSignedResponseAlg() {
|
||||||
return client.getUserInfoSignedResponseAlg();
|
return client.getUserInfoSignedResponseAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoSignedResponseAlg
|
* @param userInfoSignedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoSignedResponseAlg(JWSAlgorithm userInfoSignedResponseAlg) {
|
public void setUserInfoSignedResponseAlg(JWSAlgorithm userInfoSignedResponseAlg) {
|
||||||
client.setUserInfoSignedResponseAlg(userInfoSignedResponseAlg);
|
client.setUserInfoSignedResponseAlg(userInfoSignedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseAlg()
|
||||||
*/
|
*/
|
||||||
public JWEAlgorithm getUserInfoEncryptedResponseAlg() {
|
public JWEAlgorithm getUserInfoEncryptedResponseAlg() {
|
||||||
return client.getUserInfoEncryptedResponseAlg();
|
return client.getUserInfoEncryptedResponseAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoEncryptedResponseAlg
|
* @param userInfoEncryptedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoEncryptedResponseAlg(JWEAlgorithm userInfoEncryptedResponseAlg) {
|
public void setUserInfoEncryptedResponseAlg(JWEAlgorithm userInfoEncryptedResponseAlg) {
|
||||||
client.setUserInfoEncryptedResponseAlg(userInfoEncryptedResponseAlg);
|
client.setUserInfoEncryptedResponseAlg(userInfoEncryptedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEnc()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getUserInfoEncryptedResponseEnc()
|
||||||
*/
|
*/
|
||||||
public EncryptionMethod getUserInfoEncryptedResponseEnc() {
|
public EncryptionMethod getUserInfoEncryptedResponseEnc() {
|
||||||
return client.getUserInfoEncryptedResponseEnc();
|
return client.getUserInfoEncryptedResponseEnc();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userInfoEncryptedResponseEnc
|
* @param userInfoEncryptedResponseEnc
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setUserInfoEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
||||||
*/
|
*/
|
||||||
public void setUserInfoEncryptedResponseEnc(EncryptionMethod userInfoEncryptedResponseEnc) {
|
public void setUserInfoEncryptedResponseEnc(EncryptionMethod userInfoEncryptedResponseEnc) {
|
||||||
client.setUserInfoEncryptedResponseEnc(userInfoEncryptedResponseEnc);
|
client.setUserInfoEncryptedResponseEnc(userInfoEncryptedResponseEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenSignedResponseAlg()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithm getIdTokenSignedResponseAlg() {
|
public JWSAlgorithm getIdTokenSignedResponseAlg() {
|
||||||
return client.getIdTokenSignedResponseAlg();
|
return client.getIdTokenSignedResponseAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenSignedResponseAlg
|
* @param idTokenSignedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenSignedResponseAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenSignedResponseAlg(JWSAlgorithm idTokenSignedResponseAlg) {
|
public void setIdTokenSignedResponseAlg(JWSAlgorithm idTokenSignedResponseAlg) {
|
||||||
client.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg);
|
client.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseAlg()
|
||||||
*/
|
*/
|
||||||
public JWEAlgorithm getIdTokenEncryptedResponseAlg() {
|
public JWEAlgorithm getIdTokenEncryptedResponseAlg() {
|
||||||
return client.getIdTokenEncryptedResponseAlg();
|
return client.getIdTokenEncryptedResponseAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenEncryptedResponseAlg
|
* @param idTokenEncryptedResponseAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseAlg(com.nimbusds.jose.JWEAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenEncryptedResponseAlg(JWEAlgorithm idTokenEncryptedResponseAlg) {
|
public void setIdTokenEncryptedResponseAlg(JWEAlgorithm idTokenEncryptedResponseAlg) {
|
||||||
client.setIdTokenEncryptedResponseAlg(idTokenEncryptedResponseAlg);
|
client.setIdTokenEncryptedResponseAlg(idTokenEncryptedResponseAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEnc()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getIdTokenEncryptedResponseEnc()
|
||||||
*/
|
*/
|
||||||
public EncryptionMethod getIdTokenEncryptedResponseEnc() {
|
public EncryptionMethod getIdTokenEncryptedResponseEnc() {
|
||||||
return client.getIdTokenEncryptedResponseEnc();
|
return client.getIdTokenEncryptedResponseEnc();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idTokenEncryptedResponseEnc
|
* @param idTokenEncryptedResponseEnc
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setIdTokenEncryptedResponseEnc(com.nimbusds.jose.EncryptionMethod)
|
||||||
*/
|
*/
|
||||||
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
public void setIdTokenEncryptedResponseEnc(EncryptionMethod idTokenEncryptedResponseEnc) {
|
||||||
client.setIdTokenEncryptedResponseEnc(idTokenEncryptedResponseEnc);
|
client.setIdTokenEncryptedResponseEnc(idTokenEncryptedResponseEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlgEmbed()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlgEmbed()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
public JWSAlgorithmEmbed getTokenEndpointAuthSigningAlgEmbed() {
|
||||||
return client.getTokenEndpointAuthSigningAlgEmbed();
|
return client.getTokenEndpointAuthSigningAlgEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param tokenEndpointAuthSigningAlgEmbed
|
* @param tokenEndpointAuthSigningAlgEmbed
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlgEmbed(org.mitre.jose.JWSAlgorithmEmbed)
|
||||||
*/
|
*/
|
||||||
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
public void setTokenEndpointAuthSigningAlgEmbed(JWSAlgorithmEmbed tokenEndpointAuthSigningAlgEmbed) {
|
||||||
client.setTokenEndpointAuthSigningAlgEmbed(tokenEndpointAuthSigningAlgEmbed);
|
client.setTokenEndpointAuthSigningAlgEmbed(tokenEndpointAuthSigningAlgEmbed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlg()
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#getTokenEndpointAuthSigningAlg()
|
||||||
*/
|
*/
|
||||||
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
public JWSAlgorithm getTokenEndpointAuthSigningAlg() {
|
||||||
return client.getTokenEndpointAuthSigningAlg();
|
return client.getTokenEndpointAuthSigningAlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param tokenEndpointAuthSigningAlg
|
* @param tokenEndpointAuthSigningAlg
|
||||||
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
* @see org.mitre.oauth2.model.ClientDetailsEntity#setTokenEndpointAuthSigningAlg(com.nimbusds.jose.JWSAlgorithm)
|
||||||
*/
|
*/
|
||||||
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
public void setTokenEndpointAuthSigningAlg(JWSAlgorithm tokenEndpointAuthSigningAlg) {
|
||||||
client.setTokenEndpointAuthSigningAlg(tokenEndpointAuthSigningAlg);
|
client.setTokenEndpointAuthSigningAlg(tokenEndpointAuthSigningAlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -51,7 +51,7 @@ public class SystemScope {
|
||||||
private boolean structured = false; // is this a default scope for newly-registered clients?
|
private boolean structured = false; // is this a default scope for newly-registered clients?
|
||||||
private String structuredParamDescription;
|
private String structuredParamDescription;
|
||||||
private String structuredValue;
|
private String structuredValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a blank system scope with no value
|
* Make a blank system scope with no value
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ public class SystemScope {
|
||||||
public SystemScope(String value) {
|
public SystemScope(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the id
|
* @return the id
|
||||||
*/
|
*/
|
||||||
|
@ -147,14 +147,14 @@ public class SystemScope {
|
||||||
public boolean isDefaultScope() {
|
public boolean isDefaultScope() {
|
||||||
return defaultScope;
|
return defaultScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param defaultScope the defaultScope to set
|
* @param defaultScope the defaultScope to set
|
||||||
*/
|
*/
|
||||||
public void setDefaultScope(boolean defaultScope) {
|
public void setDefaultScope(boolean defaultScope) {
|
||||||
this.defaultScope = defaultScope;
|
this.defaultScope = defaultScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the isStructured status
|
* @return the isStructured status
|
||||||
*/
|
*/
|
||||||
|
@ -163,7 +163,7 @@ public class SystemScope {
|
||||||
public boolean isStructured() {
|
public boolean isStructured() {
|
||||||
return structured;
|
return structured;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param structured the structured to set
|
* @param structured the structured to set
|
||||||
*/
|
*/
|
||||||
|
@ -176,7 +176,7 @@ public class SystemScope {
|
||||||
public String getStructuredParamDescription() {
|
public String getStructuredParamDescription() {
|
||||||
return structuredParamDescription;
|
return structuredParamDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isStructured the isStructured to set
|
* @param isStructured the isStructured to set
|
||||||
*/
|
*/
|
||||||
|
@ -184,7 +184,7 @@ public class SystemScope {
|
||||||
this.structuredParamDescription = d;
|
this.structuredParamDescription = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the structuredValue
|
* @return the structuredValue
|
||||||
*/
|
*/
|
||||||
|
@ -204,98 +204,98 @@ public class SystemScope {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#hashCode()
|
* @see java.lang.Object#hashCode()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (allowDynReg ? 1231 : 1237);
|
result = prime * result + (allowDynReg ? 1231 : 1237);
|
||||||
result = prime * result + (defaultScope ? 1231 : 1237);
|
result = prime * result + (defaultScope ? 1231 : 1237);
|
||||||
result = prime * result + ((description == null) ? 0 : description.hashCode());
|
result = prime * result + ((description == null) ? 0 : description.hashCode());
|
||||||
result = prime * result + ((icon == null) ? 0 : icon.hashCode());
|
result = prime * result + ((icon == null) ? 0 : icon.hashCode());
|
||||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||||
result = prime * result + (structured ? 1231 : 1237);
|
result = prime * result + (structured ? 1231 : 1237);
|
||||||
result = prime * result + ((structuredParamDescription == null) ? 0 : structuredParamDescription.hashCode());
|
result = prime * result + ((structuredParamDescription == null) ? 0 : structuredParamDescription.hashCode());
|
||||||
result = prime * result + ((structuredValue == null) ? 0 : structuredValue.hashCode());
|
result = prime * result + ((structuredValue == null) ? 0 : structuredValue.hashCode());
|
||||||
result = prime * result + ((value == null) ? 0 : value.hashCode());
|
result = prime * result + ((value == null) ? 0 : value.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof SystemScope)) {
|
if (!(obj instanceof SystemScope)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SystemScope other = (SystemScope) obj;
|
SystemScope other = (SystemScope) obj;
|
||||||
if (allowDynReg != other.allowDynReg) {
|
if (allowDynReg != other.allowDynReg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (defaultScope != other.defaultScope) {
|
if (defaultScope != other.defaultScope) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (description == null) {
|
if (description == null) {
|
||||||
if (other.description != null) {
|
if (other.description != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!description.equals(other.description)) {
|
} else if (!description.equals(other.description)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (icon == null) {
|
if (icon == null) {
|
||||||
if (other.icon != null) {
|
if (other.icon != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!icon.equals(other.icon)) {
|
} else if (!icon.equals(other.icon)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
if (other.id != null) {
|
if (other.id != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!id.equals(other.id)) {
|
} else if (!id.equals(other.id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (structured != other.structured) {
|
if (structured != other.structured) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (structuredParamDescription == null) {
|
if (structuredParamDescription == null) {
|
||||||
if (other.structuredParamDescription != null) {
|
if (other.structuredParamDescription != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!structuredParamDescription.equals(other.structuredParamDescription)) {
|
} else if (!structuredParamDescription.equals(other.structuredParamDescription)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (structuredValue == null) {
|
if (structuredValue == null) {
|
||||||
if (other.structuredValue != null) {
|
if (other.structuredValue != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!structuredValue.equals(other.structuredValue)) {
|
} else if (!structuredValue.equals(other.structuredValue)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
if (other.value != null) {
|
if (other.value != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!value.equals(other.value)) {
|
} else if (!value.equals(other.value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#toString()
|
* @see java.lang.Object#toString()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SystemScope [id=" + id + ", value=" + value + ", description=" + description + ", icon=" + icon + ", allowDynReg=" + allowDynReg + ", defaultScope=" + defaultScope + ", structured=" + structured + ", structuredParamDescription=" + structuredParamDescription + ", structuredValue="
|
return "SystemScope [id=" + id + ", value=" + value + ", description=" + description + ", icon=" + icon + ", allowDynReg=" + allowDynReg + ", defaultScope=" + defaultScope + ", structured=" + structured + ", structuredParamDescription=" + structuredParamDescription + ", structuredValue="
|
||||||
+ structuredValue + "]";
|
+ structuredValue + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -32,7 +32,7 @@ public interface SystemScopeService {
|
||||||
public static final String OFFLINE_ACCESS = "offline_access";
|
public static final String OFFLINE_ACCESS = "offline_access";
|
||||||
public static final String ID_TOKEN_SCOPE = "id-token";
|
public static final String ID_TOKEN_SCOPE = "id-token";
|
||||||
public static final String REGISTRATION_TOKEN_SCOPE = "registration-token";
|
public static final String REGISTRATION_TOKEN_SCOPE = "registration-token";
|
||||||
|
|
||||||
public Set<SystemScope> getAll();
|
public Set<SystemScope> getAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,7 +80,7 @@ public interface SystemScopeService {
|
||||||
public boolean scopesMatch(Set<String> expected, Set<String> actual);
|
public boolean scopesMatch(Set<String> expected, Set<String> actual);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove any system-restricted scopes from the set and return the result.
|
* Remove any system-restricted scopes from the set and return the result.
|
||||||
* @param scopes
|
* @param scopes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -20,6 +20,14 @@
|
||||||
package org.mitre.openid.connect;
|
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;
|
||||||
import org.mitre.oauth2.model.ClientDetailsEntity.AppType;
|
import org.mitre.oauth2.model.ClientDetailsEntity.AppType;
|
||||||
import org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod;
|
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.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import static org.mitre.discovery.util.JsonUtils.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
|
@ -110,7 +116,7 @@ public class ClientDetailsEntityJsonProcessor {
|
||||||
c.setIdTokenSignedResponseAlg(getAsJwsAlgorithm(o, "id_token_signed_response_alg"));
|
c.setIdTokenSignedResponseAlg(getAsJwsAlgorithm(o, "id_token_signed_response_alg"));
|
||||||
c.setIdTokenEncryptedResponseAlg(getAsJweAlgorithm(o, "id_token_encrypted_response_alg"));
|
c.setIdTokenEncryptedResponseAlg(getAsJweAlgorithm(o, "id_token_encrypted_response_alg"));
|
||||||
c.setIdTokenEncryptedResponseEnc(getAsJweEncryptionMethod(o, "id_token_encrypted_response_enc"));
|
c.setIdTokenEncryptedResponseEnc(getAsJweEncryptionMethod(o, "id_token_encrypted_response_enc"));
|
||||||
|
|
||||||
c.setTokenEndpointAuthSigningAlg(getAsJwsAlgorithm(o, "token_endpoint_auth_signing_alg"));
|
c.setTokenEndpointAuthSigningAlg(getAsJwsAlgorithm(o, "token_endpoint_auth_signing_alg"));
|
||||||
|
|
||||||
if (o.has("default_max_age")) {
|
if (o.has("default_max_age")) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -36,129 +36,129 @@ public class ServerConfiguration {
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
issuer
|
issuer
|
||||||
REQUIRED. URL using the https scheme with no query or fragment component that the OP asserts as its Issuer Identifier.
|
REQUIRED. URL using the https scheme with no query or fragment component that the OP asserts as its Issuer Identifier.
|
||||||
authorization_endpoint
|
authorization_endpoint
|
||||||
OPTIONAL. URL of the OP's Authentication and Authorization Endpoint [OpenID.Messages].
|
OPTIONAL. URL of the OP's Authentication and Authorization Endpoint [OpenID.Messages].
|
||||||
token_endpoint
|
token_endpoint
|
||||||
OPTIONAL. URL of the OP's OAuth 2.0 Token Endpoint [OpenID.Messages].
|
OPTIONAL. URL of the OP's OAuth 2.0 Token Endpoint [OpenID.Messages].
|
||||||
userinfo_endpoint
|
userinfo_endpoint
|
||||||
RECOMMENDED. URL of the OP's UserInfo Endpoint [OpenID.Messages]. This URL MUST use the
|
RECOMMENDED. URL of the OP's UserInfo Endpoint [OpenID.Messages]. This URL MUST use the
|
||||||
https scheme and MAY contain port, path, and query parameter components.
|
https scheme and MAY contain port, path, and query parameter components.
|
||||||
check_session_iframe
|
check_session_iframe
|
||||||
OPTIONAL. URL of an OP endpoint that provides a page to support cross-origin communications for
|
OPTIONAL. URL of an OP endpoint that provides a page to support cross-origin communications for
|
||||||
session state information with the RP Client, using the HTML5 postMessage API. The page is loaded
|
session state information with the RP Client, using the HTML5 postMessage API. The page is loaded
|
||||||
from an invisible iframe embedded in an RP page so that it can run in the OP's security context. See [OpenID.Session].
|
from an invisible iframe embedded in an RP page so that it can run in the OP's security context. See [OpenID.Session].
|
||||||
end_session_endpoint
|
end_session_endpoint
|
||||||
OPTIONAL. URL of the OP's endpoint that initiates logging out the End-User. See [OpenID.Session].
|
OPTIONAL. URL of the OP's endpoint that initiates logging out the End-User. See [OpenID.Session].
|
||||||
jwks_uri
|
jwks_uri
|
||||||
REQUIRED. URL of the OP's JSON Web Key Set [JWK] document. This contains the signing key(s) the
|
REQUIRED. URL of the OP's JSON Web Key Set [JWK] document. This contains the signing key(s) the
|
||||||
Client uses to validate signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s), which are used by Clients to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the document to indicate each key's intended usage.
|
Client uses to validate signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s), which are used by Clients to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the document to indicate each key's intended usage.
|
||||||
registration_endpoint
|
registration_endpoint
|
||||||
RECOMMENDED. URL of the OP's Dynamic Client Registration Endpoint [OpenID.Registration].
|
RECOMMENDED. URL of the OP's Dynamic Client Registration Endpoint [OpenID.Registration].
|
||||||
scopes_supported
|
scopes_supported
|
||||||
RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749] scope values that this server
|
RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749] scope values that this server
|
||||||
response_types_supported
|
response_types_supported
|
||||||
REQUIRED. JSON array containing a list of the OAuth 2.0 response_type values that this server
|
REQUIRED. JSON array containing a list of the OAuth 2.0 response_type values that this server
|
||||||
supports. The server MUST support the code, id_token, and the token id_token response type values.
|
supports. The server MUST support the code, id_token, and the token id_token response type values.
|
||||||
grant_types_supported
|
grant_types_supported
|
||||||
OPTIONAL. JSON array containing a list of the OAuth 2.0 grant type values that this server supports.
|
OPTIONAL. JSON array containing a list of the OAuth 2.0 grant type values that this server supports.
|
||||||
The server MUST support the authorization_code and implicit grant type values and MAY support the
|
The server MUST support the authorization_code and implicit grant type values and MAY support the
|
||||||
urn:ietf:params:oauth:grant-type:jwt-bearer grant type defined in OAuth JWT Bearer Token Profiles [OAuth.JWT].
|
urn:ietf:params:oauth:grant-type:jwt-bearer grant type defined in OAuth JWT Bearer Token Profiles [OAuth.JWT].
|
||||||
If omitted, the default value is ["authorization_code", "implicit"].
|
If omitted, the default value is ["authorization_code", "implicit"].
|
||||||
acr_values_supported
|
acr_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the Authentication Context Class References that this server supports.
|
OPTIONAL. JSON array containing a list of the Authentication Context Class References that this server supports.
|
||||||
subject_types_supported
|
subject_types_supported
|
||||||
REQUIRED. JSON array containing a list of the subject identifier types that this server supports.
|
REQUIRED. JSON array containing a list of the subject identifier types that this server supports.
|
||||||
Valid types include pairwise and public.
|
Valid types include pairwise and public.
|
||||||
userinfo_signing_alg_values_supported
|
userinfo_signing_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported
|
OPTIONAL. JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported
|
||||||
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
||||||
userinfo_encryption_alg_values_supported
|
userinfo_encryption_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE [JWE] encryption algorithms (alg values) [JWA] supported
|
OPTIONAL. JSON array containing a list of the JWE [JWE] encryption algorithms (alg values) [JWA] supported
|
||||||
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
||||||
userinfo_encryption_enc_values_supported
|
userinfo_encryption_enc_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) [JWA] supported
|
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) [JWA] supported
|
||||||
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
|
||||||
id_token_signing_alg_values_supported
|
id_token_signing_alg_values_supported
|
||||||
REQUIRED. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
REQUIRED. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
||||||
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
||||||
id_token_encryption_alg_values_supported
|
id_token_encryption_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (alg values) supported by the
|
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (alg values) supported by the
|
||||||
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
||||||
id_token_encryption_enc_values_supported
|
id_token_encryption_enc_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) supported by the
|
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) supported by the
|
||||||
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
Authorization Server for the ID Token to encode the Claims in a JWT [JWT].
|
||||||
request_object_signing_alg_values_supported
|
request_object_signing_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
OPTIONAL. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
||||||
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
||||||
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value (using the
|
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value (using the
|
||||||
request parameter) and when it is passed by reference (using the request_uri parameter). Servers SHOULD
|
request parameter) and when it is passed by reference (using the request_uri parameter). Servers SHOULD
|
||||||
support none and RS256.
|
support none and RS256.
|
||||||
request_object_encryption_alg_values_supported
|
request_object_encryption_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (alg values) supported by the
|
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (alg values) supported by the
|
||||||
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
||||||
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value and when it
|
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value and when it
|
||||||
is passed by reference.
|
is passed by reference.
|
||||||
request_object_encryption_enc_values_supported
|
request_object_encryption_enc_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) supported by the
|
OPTIONAL. JSON array containing a list of the JWE encryption algorithms (enc values) supported by the
|
||||||
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
Authorization Server for the Request Object described in Section 2.9 of OpenID Connect Messages 1.0
|
||||||
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value and when
|
[OpenID.Messages]. These algorithms are used both when the Request Object is passed by value and when
|
||||||
it is passed by reference.
|
it is passed by reference.
|
||||||
token_endpoint_auth_methods_supported
|
token_endpoint_auth_methods_supported
|
||||||
OPTIONAL. JSON array containing a list of authentication methods supported by this Token Endpoint.
|
OPTIONAL. JSON array containing a list of authentication methods supported by this Token Endpoint.
|
||||||
The options are client_secret_post, client_secret_basic, client_secret_jwt, and private_key_jwt, as
|
The options are client_secret_post, client_secret_basic, client_secret_jwt, and private_key_jwt, as
|
||||||
described in Section 2.2.1 of OpenID Connect Messages 1.0 [OpenID.Messages]. Other authentication
|
described in Section 2.2.1 of OpenID Connect Messages 1.0 [OpenID.Messages]. Other authentication
|
||||||
methods MAY be defined by extensions. If omitted, the default is client_secret_basic -- the HTTP
|
methods MAY be defined by extensions. If omitted, the default is client_secret_basic -- the HTTP
|
||||||
Basic Authentication Scheme as specified in Section 2.3.1 of OAuth 2.0 [RFC6749].
|
Basic Authentication Scheme as specified in Section 2.3.1 of OAuth 2.0 [RFC6749].
|
||||||
token_endpoint_auth_signing_alg_values_supported
|
token_endpoint_auth_signing_alg_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
OPTIONAL. JSON array containing a list of the JWS signing algorithms (alg values) supported by the
|
||||||
Token Endpoint for the private_key_jwt and client_secret_jwt methods to encode the JWT [JWT]. Servers
|
Token Endpoint for the private_key_jwt and client_secret_jwt methods to encode the JWT [JWT]. Servers
|
||||||
SHOULD support RS256.
|
SHOULD support RS256.
|
||||||
display_values_supported
|
display_values_supported
|
||||||
OPTIONAL. JSON array containing a list of the display parameter values that the OpenID Provider
|
OPTIONAL. JSON array containing a list of the display parameter values that the OpenID Provider
|
||||||
supports. These values are described in Section 2.1.1 of OpenID Connect Messages 1.0 [OpenID.Messages].
|
supports. These values are described in Section 2.1.1 of OpenID Connect Messages 1.0 [OpenID.Messages].
|
||||||
claim_types_supported
|
claim_types_supported
|
||||||
OPTIONAL. JSON array containing a list of the Claim Types that the OpenID Provider supports. These Claim
|
OPTIONAL. JSON array containing a list of the Claim Types that the OpenID Provider supports. These Claim
|
||||||
Types are described in Section 2.6 of OpenID Connect Messages 1.0 [OpenID.Messages]. Values defined by
|
Types are described in Section 2.6 of OpenID Connect Messages 1.0 [OpenID.Messages]. Values defined by
|
||||||
this specification are normal, aggregated, and distributed. If not specified, the implementation supports
|
this specification are normal, aggregated, and distributed. If not specified, the implementation supports
|
||||||
only normal Claims.
|
only normal Claims.
|
||||||
claims_supported
|
claims_supported
|
||||||
RECOMMENDED. JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY
|
RECOMMENDED. JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY
|
||||||
be able to supply values for. Note that for privacy or other reasons, this might not be an exhaustive list.
|
be able to supply values for. Note that for privacy or other reasons, this might not be an exhaustive list.
|
||||||
service_documentation
|
service_documentation
|
||||||
OPTIONAL. URL of a page containing human-readable information that developers might want or need to
|
OPTIONAL. URL of a page containing human-readable information that developers might want or need to
|
||||||
know when using the OpenID Provider. In particular, if the OpenID Provider does not support Dynamic
|
know when using the OpenID Provider. In particular, if the OpenID Provider does not support Dynamic
|
||||||
Client Registration, then information on how to register Clients needs to be provided in this documentation.
|
Client Registration, then information on how to register Clients needs to be provided in this documentation.
|
||||||
claims_locales_supported
|
claims_locales_supported
|
||||||
OPTIONAL. Languages and scripts supported for values in Claims being returned, represented as a JSON array
|
OPTIONAL. Languages and scripts supported for values in Claims being returned, represented as a JSON array
|
||||||
of BCP47 [RFC5646] language tag values. Not all languages and scripts are necessarily supported for all
|
of BCP47 [RFC5646] language tag values. Not all languages and scripts are necessarily supported for all
|
||||||
Claim values.
|
Claim values.
|
||||||
ui_locales_supported
|
ui_locales_supported
|
||||||
OPTIONAL. Languages and scripts supported for the user interface, represented as a JSON array of BCP47
|
OPTIONAL. Languages and scripts supported for the user interface, represented as a JSON array of BCP47
|
||||||
[RFC5646] language tag values.
|
[RFC5646] language tag values.
|
||||||
claims_parameter_supported
|
claims_parameter_supported
|
||||||
OPTIONAL. Boolean value specifying whether the OP supports use of the claims parameter, with true
|
OPTIONAL. Boolean value specifying whether the OP supports use of the claims parameter, with true
|
||||||
indicating support. If omitted, the default value is false.
|
indicating support. If omitted, the default value is false.
|
||||||
request_parameter_supported
|
request_parameter_supported
|
||||||
OPTIONAL. Boolean value specifying whether the OP supports use of the request parameter, with true
|
OPTIONAL. Boolean value specifying whether the OP supports use of the request parameter, with true
|
||||||
indicating support. If omitted, the default value is false.
|
indicating support. If omitted, the default value is false.
|
||||||
request_uri_parameter_supported
|
request_uri_parameter_supported
|
||||||
OPTIONAL. Boolean value specifying whether the OP supports use of the request_uri parameter, with
|
OPTIONAL. Boolean value specifying whether the OP supports use of the request_uri parameter, with
|
||||||
true indicating support. If omitted, the default value is true.
|
true indicating support. If omitted, the default value is true.
|
||||||
require_request_uri_registration
|
require_request_uri_registration
|
||||||
OPTIONAL. Boolean value specifying whether the OP requires any request_uri values used to be
|
OPTIONAL. Boolean value specifying whether the OP requires any request_uri values used to be
|
||||||
pre-registered using the request_uris registration parameter. Pre-registration is REQUIRED when
|
pre-registered using the request_uris registration parameter. Pre-registration is REQUIRED when
|
||||||
the value is true. If omitted, the default value is false.
|
the value is true. If omitted, the default value is false.
|
||||||
op_policy_uri
|
op_policy_uri
|
||||||
OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to read
|
OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to read
|
||||||
about the OP's requirements on how the Relying Party can use the data provided by the OP. The
|
about the OP's requirements on how the Relying Party can use the data provided by the OP. The
|
||||||
registration process SHOULD display this URL to the person registering the Client if it is given.
|
registration process SHOULD display this URL to the person registering the Client if it is given.
|
||||||
op_tos_uri
|
op_tos_uri
|
||||||
OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to read about
|
OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to read about
|
||||||
OpenID Provider's terms of service. The registration process SHOULD display this URL to the person
|
OpenID Provider's terms of service. The registration process SHOULD display this URL to the person
|
||||||
registering the Client if it is given.
|
registering the Client if it is given.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String authorizationEndpointUri;
|
private String authorizationEndpointUri;
|
||||||
|
|
||||||
private String tokenEndpointUri;
|
private String tokenEndpointUri;
|
||||||
|
@ -172,7 +172,7 @@ public class ServerConfiguration {
|
||||||
private String userInfoUri;
|
private String userInfoUri;
|
||||||
|
|
||||||
private String introspectionEndpointUri;
|
private String introspectionEndpointUri;
|
||||||
|
|
||||||
private String revocationEndpointUri;
|
private String revocationEndpointUri;
|
||||||
|
|
||||||
public String getRevocationEndpointUri() {
|
public String getRevocationEndpointUri() {
|
||||||
|
@ -1094,6 +1094,6 @@ public class ServerConfiguration {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -149,85 +149,85 @@ public class Address {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#hashCode()
|
* @see java.lang.Object#hashCode()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((country == null) ? 0 : country.hashCode());
|
result = prime * result + ((country == null) ? 0 : country.hashCode());
|
||||||
result = prime * result + ((formatted == null) ? 0 : formatted.hashCode());
|
result = prime * result + ((formatted == null) ? 0 : formatted.hashCode());
|
||||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||||
result = prime * result + ((locality == null) ? 0 : locality.hashCode());
|
result = prime * result + ((locality == null) ? 0 : locality.hashCode());
|
||||||
result = prime * result + ((postalCode == null) ? 0 : postalCode.hashCode());
|
result = prime * result + ((postalCode == null) ? 0 : postalCode.hashCode());
|
||||||
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
||||||
result = prime * result + ((streetAddress == null) ? 0 : streetAddress.hashCode());
|
result = prime * result + ((streetAddress == null) ? 0 : streetAddress.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof Address)) {
|
if (!(obj instanceof Address)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Address other = (Address) obj;
|
Address other = (Address) obj;
|
||||||
if (country == null) {
|
if (country == null) {
|
||||||
if (other.country != null) {
|
if (other.country != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!country.equals(other.country)) {
|
} else if (!country.equals(other.country)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formatted == null) {
|
if (formatted == null) {
|
||||||
if (other.formatted != null) {
|
if (other.formatted != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!formatted.equals(other.formatted)) {
|
} else if (!formatted.equals(other.formatted)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
if (other.id != null) {
|
if (other.id != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!id.equals(other.id)) {
|
} else if (!id.equals(other.id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (locality == null) {
|
if (locality == null) {
|
||||||
if (other.locality != null) {
|
if (other.locality != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!locality.equals(other.locality)) {
|
} else if (!locality.equals(other.locality)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (postalCode == null) {
|
if (postalCode == null) {
|
||||||
if (other.postalCode != null) {
|
if (other.postalCode != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!postalCode.equals(other.postalCode)) {
|
} else if (!postalCode.equals(other.postalCode)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (region == null) {
|
if (region == null) {
|
||||||
if (other.region != null) {
|
if (other.region != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!region.equals(other.region)) {
|
} else if (!region.equals(other.region)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (streetAddress == null) {
|
if (streetAddress == null) {
|
||||||
if (other.streetAddress != null) {
|
if (other.streetAddress != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!streetAddress.equals(other.streetAddress)) {
|
} else if (!streetAddress.equals(other.streetAddress)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -336,19 +336,19 @@ public class DefaultUserInfo implements UserInfo {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.openid.connect.model.UserInfo#getPhoneNumberVerified()
|
* @see org.mitre.openid.connect.model.UserInfo#getPhoneNumberVerified()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Basic
|
@Basic
|
||||||
@Column(name="phone_number_verified")
|
@Column(name="phone_number_verified")
|
||||||
public Boolean getPhoneNumberVerified() {
|
public Boolean getPhoneNumberVerified() {
|
||||||
return phoneNumberVerified;
|
return phoneNumberVerified;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.openid.connect.model.UserInfo#setPhoneNumberVerified(java.lang.Boolean)
|
* @see org.mitre.openid.connect.model.UserInfo#setPhoneNumberVerified(java.lang.Boolean)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setPhoneNumberVerified(Boolean phoneNumberVerified) {
|
public void setPhoneNumberVerified(Boolean phoneNumberVerified) {
|
||||||
this.phoneNumberVerified = phoneNumberVerified;
|
this.phoneNumberVerified = phoneNumberVerified;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.mitre.openid.connect.model.UserInfo#getAddress()
|
* @see org.mitre.openid.connect.model.UserInfo#getAddress()
|
||||||
*/
|
*/
|
||||||
|
@ -398,7 +398,7 @@ public class DefaultUserInfo implements UserInfo {
|
||||||
public void setBirthdate(String birthdate) {
|
public void setBirthdate(String birthdate) {
|
||||||
this.birthdate = birthdate;
|
this.birthdate = birthdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonObject toJson() {
|
public JsonObject toJson() {
|
||||||
JsonObject obj = new JsonObject();
|
JsonObject obj = new JsonObject();
|
||||||
|
@ -419,7 +419,7 @@ public class DefaultUserInfo implements UserInfo {
|
||||||
obj.addProperty("locale", this.getLocale());
|
obj.addProperty("locale", this.getLocale());
|
||||||
obj.addProperty("updated_time", this.getUpdatedTime());
|
obj.addProperty("updated_time", this.getUpdatedTime());
|
||||||
obj.addProperty("birthdate", this.getBirthdate());
|
obj.addProperty("birthdate", this.getBirthdate());
|
||||||
|
|
||||||
obj.addProperty("email", this.getEmail());
|
obj.addProperty("email", this.getEmail());
|
||||||
obj.addProperty("email_verified", this.getEmailVerified());
|
obj.addProperty("email_verified", this.getEmailVerified());
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ public class DefaultUserInfo implements UserInfo {
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a JsonObject into a UserInfo.
|
* Parse a JsonObject into a UserInfo.
|
||||||
* @param o
|
* @param o
|
||||||
|
@ -490,201 +490,201 @@ public class DefaultUserInfo implements UserInfo {
|
||||||
return ui;
|
return ui;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#hashCode()
|
* @see java.lang.Object#hashCode()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((address == null) ? 0 : address.hashCode());
|
result = prime * result + ((address == null) ? 0 : address.hashCode());
|
||||||
result = prime * result + ((birthdate == null) ? 0 : birthdate.hashCode());
|
result = prime * result + ((birthdate == null) ? 0 : birthdate.hashCode());
|
||||||
result = prime * result + ((email == null) ? 0 : email.hashCode());
|
result = prime * result + ((email == null) ? 0 : email.hashCode());
|
||||||
result = prime * result + ((emailVerified == null) ? 0 : emailVerified.hashCode());
|
result = prime * result + ((emailVerified == null) ? 0 : emailVerified.hashCode());
|
||||||
result = prime * result + ((familyName == null) ? 0 : familyName.hashCode());
|
result = prime * result + ((familyName == null) ? 0 : familyName.hashCode());
|
||||||
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
|
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
|
||||||
result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
|
result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
|
||||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||||
result = prime * result + ((locale == null) ? 0 : locale.hashCode());
|
result = prime * result + ((locale == null) ? 0 : locale.hashCode());
|
||||||
result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
|
result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
|
||||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||||
result = prime * result + ((nickname == null) ? 0 : nickname.hashCode());
|
result = prime * result + ((nickname == null) ? 0 : nickname.hashCode());
|
||||||
result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
|
result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
|
||||||
result = prime * result + ((phoneNumberVerified == null) ? 0 : phoneNumberVerified.hashCode());
|
result = prime * result + ((phoneNumberVerified == null) ? 0 : phoneNumberVerified.hashCode());
|
||||||
result = prime * result + ((picture == null) ? 0 : picture.hashCode());
|
result = prime * result + ((picture == null) ? 0 : picture.hashCode());
|
||||||
result = prime * result + ((preferredUsername == null) ? 0 : preferredUsername.hashCode());
|
result = prime * result + ((preferredUsername == null) ? 0 : preferredUsername.hashCode());
|
||||||
result = prime * result + ((profile == null) ? 0 : profile.hashCode());
|
result = prime * result + ((profile == null) ? 0 : profile.hashCode());
|
||||||
result = prime * result + ((sub == null) ? 0 : sub.hashCode());
|
result = prime * result + ((sub == null) ? 0 : sub.hashCode());
|
||||||
result = prime * result + ((updatedTime == null) ? 0 : updatedTime.hashCode());
|
result = prime * result + ((updatedTime == null) ? 0 : updatedTime.hashCode());
|
||||||
result = prime * result + ((website == null) ? 0 : website.hashCode());
|
result = prime * result + ((website == null) ? 0 : website.hashCode());
|
||||||
result = prime * result + ((zoneinfo == null) ? 0 : zoneinfo.hashCode());
|
result = prime * result + ((zoneinfo == null) ? 0 : zoneinfo.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof DefaultUserInfo)) {
|
if (!(obj instanceof DefaultUserInfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DefaultUserInfo other = (DefaultUserInfo) obj;
|
DefaultUserInfo other = (DefaultUserInfo) obj;
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
if (other.address != null) {
|
if (other.address != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!address.equals(other.address)) {
|
} else if (!address.equals(other.address)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (birthdate == null) {
|
if (birthdate == null) {
|
||||||
if (other.birthdate != null) {
|
if (other.birthdate != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!birthdate.equals(other.birthdate)) {
|
} else if (!birthdate.equals(other.birthdate)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (email == null) {
|
if (email == null) {
|
||||||
if (other.email != null) {
|
if (other.email != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!email.equals(other.email)) {
|
} else if (!email.equals(other.email)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (emailVerified == null) {
|
if (emailVerified == null) {
|
||||||
if (other.emailVerified != null) {
|
if (other.emailVerified != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!emailVerified.equals(other.emailVerified)) {
|
} else if (!emailVerified.equals(other.emailVerified)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (familyName == null) {
|
if (familyName == null) {
|
||||||
if (other.familyName != null) {
|
if (other.familyName != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!familyName.equals(other.familyName)) {
|
} else if (!familyName.equals(other.familyName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (gender == null) {
|
if (gender == null) {
|
||||||
if (other.gender != null) {
|
if (other.gender != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!gender.equals(other.gender)) {
|
} else if (!gender.equals(other.gender)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (givenName == null) {
|
if (givenName == null) {
|
||||||
if (other.givenName != null) {
|
if (other.givenName != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!givenName.equals(other.givenName)) {
|
} else if (!givenName.equals(other.givenName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
if (other.id != null) {
|
if (other.id != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!id.equals(other.id)) {
|
} else if (!id.equals(other.id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (locale == null) {
|
if (locale == null) {
|
||||||
if (other.locale != null) {
|
if (other.locale != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!locale.equals(other.locale)) {
|
} else if (!locale.equals(other.locale)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (middleName == null) {
|
if (middleName == null) {
|
||||||
if (other.middleName != null) {
|
if (other.middleName != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!middleName.equals(other.middleName)) {
|
} else if (!middleName.equals(other.middleName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
if (other.name != null) {
|
if (other.name != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!name.equals(other.name)) {
|
} else if (!name.equals(other.name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (nickname == null) {
|
if (nickname == null) {
|
||||||
if (other.nickname != null) {
|
if (other.nickname != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!nickname.equals(other.nickname)) {
|
} else if (!nickname.equals(other.nickname)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (phoneNumber == null) {
|
if (phoneNumber == null) {
|
||||||
if (other.phoneNumber != null) {
|
if (other.phoneNumber != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!phoneNumber.equals(other.phoneNumber)) {
|
} else if (!phoneNumber.equals(other.phoneNumber)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (phoneNumberVerified == null) {
|
if (phoneNumberVerified == null) {
|
||||||
if (other.phoneNumberVerified != null) {
|
if (other.phoneNumberVerified != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!phoneNumberVerified.equals(other.phoneNumberVerified)) {
|
} else if (!phoneNumberVerified.equals(other.phoneNumberVerified)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (picture == null) {
|
if (picture == null) {
|
||||||
if (other.picture != null) {
|
if (other.picture != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!picture.equals(other.picture)) {
|
} else if (!picture.equals(other.picture)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (preferredUsername == null) {
|
if (preferredUsername == null) {
|
||||||
if (other.preferredUsername != null) {
|
if (other.preferredUsername != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!preferredUsername.equals(other.preferredUsername)) {
|
} else if (!preferredUsername.equals(other.preferredUsername)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
if (other.profile != null) {
|
if (other.profile != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!profile.equals(other.profile)) {
|
} else if (!profile.equals(other.profile)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sub == null) {
|
if (sub == null) {
|
||||||
if (other.sub != null) {
|
if (other.sub != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!sub.equals(other.sub)) {
|
} else if (!sub.equals(other.sub)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (updatedTime == null) {
|
if (updatedTime == null) {
|
||||||
if (other.updatedTime != null) {
|
if (other.updatedTime != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!updatedTime.equals(other.updatedTime)) {
|
} else if (!updatedTime.equals(other.updatedTime)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (website == null) {
|
if (website == null) {
|
||||||
if (other.website != null) {
|
if (other.website != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!website.equals(other.website)) {
|
} else if (!website.equals(other.website)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (zoneinfo == null) {
|
if (zoneinfo == null) {
|
||||||
if (other.zoneinfo != null) {
|
if (other.zoneinfo != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!zoneinfo.equals(other.zoneinfo)) {
|
} else if (!zoneinfo.equals(other.zoneinfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -58,14 +58,14 @@ public class PairwiseIdentifier {
|
||||||
public String getIdentifier() {
|
public String getIdentifier() {
|
||||||
return identifier;
|
return identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param identifier the identifier to set
|
* @param identifier the identifier to set
|
||||||
*/
|
*/
|
||||||
public void setIdentifier(String identifier) {
|
public void setIdentifier(String identifier) {
|
||||||
this.identifier = identifier;
|
this.identifier = identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the userSub
|
* @return the userSub
|
||||||
*/
|
*/
|
||||||
|
@ -74,14 +74,14 @@ public class PairwiseIdentifier {
|
||||||
public String getUserSub() {
|
public String getUserSub() {
|
||||||
return userSub;
|
return userSub;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userSub the userSub to set
|
* @param userSub the userSub to set
|
||||||
*/
|
*/
|
||||||
public void setUserSub(String userSub) {
|
public void setUserSub(String userSub) {
|
||||||
this.userSub = userSub;
|
this.userSub = userSub;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the sectorIdentifier
|
* @return the sectorIdentifier
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +90,7 @@ public class PairwiseIdentifier {
|
||||||
public String getSectorIdentifier() {
|
public String getSectorIdentifier() {
|
||||||
return sectorIdentifier;
|
return sectorIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param sectorIdentifier the sectorIdentifier to set
|
* @param sectorIdentifier the sectorIdentifier to set
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -180,12 +180,12 @@ public interface UserInfo {
|
||||||
* @param phoneNumber the phoneNumber to set
|
* @param phoneNumber the phoneNumber to set
|
||||||
*/
|
*/
|
||||||
public abstract void setPhoneNumber(String phoneNumber);
|
public abstract void setPhoneNumber(String phoneNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract Boolean getPhoneNumberVerified();
|
public abstract Boolean getPhoneNumberVerified();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param phoneNumberVerified
|
* @param phoneNumberVerified
|
||||||
|
@ -224,7 +224,7 @@ public interface UserInfo {
|
||||||
* @param birthdate
|
* @param birthdate
|
||||||
*/
|
*/
|
||||||
public abstract void setBirthdate(String birthdate);
|
public abstract void setBirthdate(String birthdate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serialize this UserInfo object to JSON
|
* Serialize this UserInfo object to JSON
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -18,13 +18,13 @@ public interface PairwiseIdentifierRepository {
|
||||||
* @param sectorIdentifierUri
|
* @param sectorIdentifierUri
|
||||||
* @return
|
* @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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -55,5 +55,5 @@ public interface OIDCTokenService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public OAuth2AccessTokenEntity createRegistrationAccessToken(ClientDetailsEntity client);
|
public OAuth2AccessTokenEntity createRegistrationAccessToken(ClientDetailsEntity client);
|
||||||
|
|
||||||
}
|
}
|
|
@ -21,6 +21,6 @@ public interface PairwiseIdentiferService {
|
||||||
* @param client
|
* @param client
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client);
|
public String getIdentifier(UserInfo userInfo, ClientDetailsEntity client);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -59,11 +59,11 @@ public interface UserInfoService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public UserInfo getByUsername(String username);
|
public UserInfo getByUsername(String username);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the UserInfo for the given username (usually maps to the
|
* Get the UserInfo for the given username (usually maps to the
|
||||||
* preferredUsername field) and clientId. This allows pairwise
|
* preferredUsername field) and clientId. This allows pairwise
|
||||||
* client identifiers where appropriate.
|
* client identifiers where appropriate.
|
||||||
* @param username
|
* @param username
|
||||||
* @param clientId
|
* @param clientId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -49,15 +49,15 @@ import com.google.gson.JsonSerializer;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
||||||
|
|
||||||
private Gson gson = new GsonBuilder()
|
private Gson gson = new GsonBuilder()
|
||||||
.registerTypeHierarchyAdapter(GrantedAuthority.class, new JsonSerializer<GrantedAuthority>() {
|
.registerTypeHierarchyAdapter(GrantedAuthority.class, new JsonSerializer<GrantedAuthority>() {
|
||||||
@Override
|
@Override
|
||||||
public JsonElement serialize(GrantedAuthority src, Type typeOfSrc, JsonSerializationContext context) {
|
public JsonElement serialize(GrantedAuthority src, Type typeOfSrc, JsonSerializationContext context) {
|
||||||
return new JsonPrimitive(src.getAuthority());
|
return new JsonPrimitive(src.getAuthority());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
|
@ -65,20 +65,20 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
||||||
@Override
|
@Override
|
||||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
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
|
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
|
// TODO: this is a patch to get around a potential information leak from #492
|
||||||
if (!(modelAndView.getView() instanceof RedirectView)) {
|
if (!(modelAndView.getView() instanceof RedirectView)) {
|
||||||
|
|
||||||
// get our principal from the security context
|
// get our principal from the security context
|
||||||
Principal p = request.getUserPrincipal();
|
Principal p = request.getUserPrincipal();
|
||||||
|
|
||||||
if (p instanceof Authentication && !modelAndView.getModel().containsKey("userAuthorities")){
|
if (p instanceof Authentication && !modelAndView.getModel().containsKey("userAuthorities")){
|
||||||
Authentication auth = (Authentication)p;
|
Authentication auth = (Authentication)p;
|
||||||
modelAndView.addObject("userAuthorities", gson.toJson(auth.getAuthorities()));
|
modelAndView.addObject("userAuthorities", gson.toJson(auth.getAuthorities()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p instanceof OIDCAuthenticationToken) {
|
if (p instanceof OIDCAuthenticationToken) {
|
||||||
// if they're logging into this server from a remote OIDC server, pass through their user info
|
// if they're logging into this server from a remote OIDC server, pass through their user info
|
||||||
OIDCAuthenticationToken oidc = (OIDCAuthenticationToken) p;
|
OIDCAuthenticationToken oidc = (OIDCAuthenticationToken) p;
|
||||||
|
@ -86,10 +86,10 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
|
||||||
modelAndView.addObject("userInfoJson", oidc.getUserInfo().toJson());
|
modelAndView.addObject("userInfoJson", oidc.getUserInfo().toJson());
|
||||||
} else {
|
} else {
|
||||||
if (p != null && p.getName() != null) { // don't bother checking if we don't have a principal
|
if (p != null && p.getName() != null) { // don't bother checking if we don't have a principal
|
||||||
|
|
||||||
// try to look up a user based on the principal's name
|
// try to look up a user based on the principal's name
|
||||||
UserInfo user = userInfoService.getByUsername(p.getName());
|
UserInfo user = userInfoService.getByUsername(p.getName());
|
||||||
|
|
||||||
// if we have one, inject it so views can use it
|
// if we have one, inject it so views can use it
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
modelAndView.addObject("userInfo", user);
|
modelAndView.addObject("userInfo", user);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -28,12 +28,12 @@ import javax.persistence.EntityManager;
|
||||||
public class JpaUtil {
|
public class JpaUtil {
|
||||||
public static <T> T getSingleResult(List<T> list) {
|
public static <T> T getSingleResult(List<T> list) {
|
||||||
switch(list.size()) {
|
switch(list.size()) {
|
||||||
case 0:
|
case 0:
|
||||||
return null;
|
return null;
|
||||||
case 1:
|
case 1:
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException("Expected single result, got " + list.size());
|
throw new IllegalStateException("Expected single result, got " + list.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright 2013 The MITRE Corporation
|
* Copyright 2013 The MITRE Corporation
|
||||||
* and the MIT Kerberos and Internet Trust Consortium
|
* and the MIT Kerberos and Internet Trust Consortium
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -16,13 +16,13 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.mitre.discovery.util;
|
package org.mitre.discovery.util;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.web.util.UriComponents;
|
import org.springframework.web.util.UriComponents;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wkim
|
* @author wkim
|
||||||
*
|
*
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue