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