Optimized the authenticator framework

4.x.x
harshanl 9 years ago
parent fa92aecf58
commit 2b9239d208

@ -36,7 +36,6 @@ import java.util.StringTokenizer;
public class WebappAuthenticationValve extends CarbonTomcatValve {
private static final Log log = LogFactory.getLog(WebappAuthenticationValve.class);
private static final String BYPASS_URIS = "bypass-uris";
private static HashMap<String, String> nonSecuredEndpoints = new HashMap<>();
@Override
@ -47,21 +46,6 @@ public class WebappAuthenticationValve extends CarbonTomcatValve {
return;
}
String byPassURIs = request.getContext().findParameter(WebappAuthenticationValve.BYPASS_URIS);
if (byPassURIs != null && !byPassURIs.isEmpty()) {
List<String> requestURI = Arrays.asList(byPassURIs.split(","));
if (requestURI != null && requestURI.size() > 0) {
for (String pathURI : requestURI) {
pathURI = pathURI.replace("\n", "").replace("\r", "").trim();
if (request.getRequestURI().equals(pathURI)) {
this.getNext().invoke(request, response, compositeValve);
return;
}
}
}
}
WebappAuthenticator authenticator = WebappAuthenticatorFactory.getAuthenticator(request);
if (authenticator == null) {
String msg = "Failed to load an appropriate authenticator to authenticate the request";
@ -131,6 +115,7 @@ public class WebappAuthenticationValve extends CarbonTomcatValve {
StringTokenizer tokenizer = new StringTokenizer(param, ",");
while (tokenizer.hasMoreTokens()) {
skippedEndPoint = ctx + tokenizer.nextToken();
skippedEndPoint = skippedEndPoint.replace("\n", "").replace("\r", "").trim();
if(!skippedEndPoint.endsWith("/")) {
skippedEndPoint = skippedEndPoint + "/";
}

Loading…
Cancel
Save