return;
}
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
Authenticator authenticator = getAuthenticator(httpServletRequest);
if (authenticator == null) {
//sendUnauthorisedError(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
} else {
if (authenticator.isAuthenticated(httpServletRequest)) {
// Allow request to flow
filterChain.doFilter(servletRequest, servletResponse);
} else {
try {
if (!authenticator.authenticate(httpServletRequest)) {
//sendUnauthorisedError(servletResponse, "Unauthorised : Provided credentials are not valid.");
populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
} else {
// Allow request to flow
filterChain.doFilter(servletRequest, servletResponse);