replaced stracktrace-printing with logger messages. removed some unused imports.
parent
f483d41b88
commit
aad432c5d7
|
@ -214,8 +214,8 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
||||||
try {
|
try {
|
||||||
jwt.sign(signer);
|
jwt.sign(signer);
|
||||||
} catch (JOSEException e) {
|
} catch (JOSEException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("Failed to sign JWT, error was: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -229,8 +229,8 @@ public class DefaultJwtSigningAndValidationService implements JwtSigningAndValid
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (JOSEException e) {
|
} catch (JOSEException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("Failed to validate signature, error was: ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -106,7 +106,6 @@ public class WebfingerView extends AbstractView {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
//TODO: Error Handling
|
|
||||||
logger.error("IOException in JsonEntityView.java: ", e);
|
logger.error("IOException in JsonEntityView.java: ", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,8 +231,8 @@ public class ConnectAuthorizationRequestManager implements AuthorizationRequestM
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("Failed to process request object, error was: ", e);
|
||||||
}
|
}
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,9 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider {
|
||||||
} catch (InvalidClientException e) {
|
} catch (InvalidClientException e) {
|
||||||
throw new UsernameNotFoundException("Could not find client: " + jwtAuth.getClientId());
|
throw new UsernameNotFoundException("Could not find client: " + jwtAuth.getClientId());
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
|
logger.error("Failure during authentication, error was: ", e);
|
||||||
|
|
||||||
throw new AuthenticationServiceException("Invalid JWT format");
|
throw new AuthenticationServiceException("Invalid JWT format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,11 +174,12 @@ public class ConnectTokenEnhancer implements TokenEnhancer {
|
||||||
idClaims.setClaim("at_hash", at_hash);
|
idClaims.setClaim("at_hash", at_hash);
|
||||||
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("No such algorithm error: ", e);
|
||||||
|
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("Invalid key error: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,10 @@ import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
|
||||||
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
|
|
||||||
import org.mitre.oauth2.model.RegisteredClient;
|
import org.mitre.oauth2.model.RegisteredClient;
|
||||||
import org.mitre.openid.connect.ClientDetailsEntityJsonProcessor;
|
import org.mitre.openid.connect.ClientDetailsEntityJsonProcessor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.servlet.view.AbstractView;
|
import org.springframework.web.servlet.view.AbstractView;
|
||||||
|
@ -49,6 +49,8 @@ import com.google.gson.JsonObject;
|
||||||
@Component("clientInformationResponseView")
|
@Component("clientInformationResponseView")
|
||||||
public class ClientInformationResponseView extends AbstractView {
|
public class ClientInformationResponseView extends AbstractView {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(ClientInformationResponseView.class);
|
||||||
|
|
||||||
// note that this won't serialize nulls by default
|
// note that this won't serialize nulls by default
|
||||||
private Gson gson = new Gson();
|
private Gson gson = new Gson();
|
||||||
|
|
||||||
|
@ -75,11 +77,13 @@ public class ClientInformationResponseView extends AbstractView {
|
||||||
Writer out = response.getWriter();
|
Writer out = response.getWriter();
|
||||||
gson.toJson(o, out);
|
gson.toJson(o, out);
|
||||||
} catch (JsonIOException e) {
|
} catch (JsonIOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("JsonIOException in ClientInformationResponseView.java: ", e);
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
logger.error("IOException in ClientInformationResponseView.java: ", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,6 @@ public class JsonEntityView extends AbstractView {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
//TODO: Error Handling
|
|
||||||
logger.error("IOException in JsonEntityView.java: ", e);
|
logger.error("IOException in JsonEntityView.java: ", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ public class JsonErrorView extends AbstractView {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
//TODO: Error Handling
|
|
||||||
logger.error("IOException in JsonErrorView.java: ", e);
|
logger.error("IOException in JsonErrorView.java: ", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,14 +102,11 @@ public class UserInfoView extends AbstractView {
|
||||||
|
|
||||||
gson.toJson(toJsonFromRequestObj(userInfo, scope, obj), out);
|
gson.toJson(toJsonFromRequestObj(userInfo, scope, obj), out);
|
||||||
} catch (JsonSyntaxException e) {
|
} catch (JsonSyntaxException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("JsonSyntaxException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JsonIOException e) {
|
} catch (JsonIOException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("JsonIOException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("ParseException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,7 +117,6 @@ public class UserInfoView extends AbstractView {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
//TODO: Error Handling
|
|
||||||
logger.error("IOException in UserInfoView.java: ", e);
|
logger.error("IOException in UserInfoView.java: ", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -223,20 +219,15 @@ public class UserInfoView extends AbstractView {
|
||||||
value = (String) getter.invoke(ui);
|
value = (String) getter.invoke(ui);
|
||||||
obj.addProperty(claimName, value);
|
obj.addProperty(claimName, value);
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("SecurityException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("NoSuchMethodException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("IllegalArgumentException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("IllegalAccessException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
// TODO Auto-generated catch block
|
logger.error("InvocationTargetException in UserInfoView.java: ", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue