From 2b9239d2086dc860ca558f74a87a6160fb17241a Mon Sep 17 00:00:00 2001 From: harshanl Date: Tue, 3 Nov 2015 14:29:38 +0530 Subject: [PATCH] Optimized the authenticator framework --- .../framework/WebappAuthenticationValve.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java index f6f077e100..bf9a80e5ca 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -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 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 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 + "/"; }