From 47ce861b49865d79dca2d807766926a7131399e6 Mon Sep 17 00:00:00 2001 From: megala21 Date: Fri, 28 Apr 2017 10:01:54 +0530 Subject: [PATCH] Fixing basic authenticator issue --- .../src/main/webapp/WEB-INF/web.xml | 5 +++++ .../framework/authenticator/BasicAuthAuthenticator.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml index 0b53726a42..823bf51d73 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml @@ -39,6 +39,11 @@ doAuthentication true + + + basicAuth + true + diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java index f384efe6f5..7de0e8c337 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java @@ -161,7 +161,7 @@ public class BasicAuthAuthenticator implements WebappAuthenticator { private boolean isAuthenticationSupported(Request request) { String param = request.getContext().findParameter("basicAuth"); - return (param == null || !Boolean.parseBoolean(param)); + return (param != null && Boolean.parseBoolean(param)); } }