From bb9e07b74237d7628a8f6978242c261bb9cde86d Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 21 Dec 2015 21:41:34 +0530 Subject: [PATCH] Fixed BSTValidator --- .../framework/authenticator/BSTAuthenticator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java index fdd03b8b6f..d44ca4665a 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java @@ -27,6 +27,7 @@ import org.apache.axiom.soap.SOAPHeaderBlock; import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.coyote.InputBuffer; @@ -130,7 +131,8 @@ public class BSTAuthenticator implements WebappAuthenticator { authenticationInfo.setStatus(WebappAuthenticator.Status.CONTINUE); } else { - String bearerToken = request.getContext().findParameter("BST"); + String bearerToken = new String( + Base64.decodeBase64(request.getContext().findParameter("BST").getBytes())); String resource = requestUri + ":" + requestMethod;