|
|
|
@ -28,8 +28,6 @@ import org.apache.catalina.connector.Request;
|
|
|
|
|
import org.apache.catalina.connector.Response;
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
|
import org.apache.tomcat.util.buf.ByteChunk;
|
|
|
|
|
import org.apache.tomcat.util.buf.MessageBytes;
|
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
|
import org.wso2.carbon.core.util.KeyStoreManager;
|
|
|
|
|
import org.wso2.carbon.user.api.TenantManager;
|
|
|
|
@ -37,13 +35,11 @@ import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
|
import org.wso2.carbon.user.api.UserStoreManager;
|
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
|
|
|
import org.wso2.carbon.webapp.authenticator.framework.Constants;
|
|
|
|
|
import org.wso2.carbon.webapp.authenticator.framework.DataHolder;
|
|
|
|
|
|
|
|
|
|
import java.security.interfaces.RSAPublicKey;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.util.StringTokenizer;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This authenticator authenticates HTTP requests using JWT header.
|
|
|
|
@ -128,6 +124,11 @@ public class JWTAuthenticator implements WebappAuthenticator {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String decodeAuthorizationHeader(String authorizationHeader) {
|
|
|
|
|
|
|
|
|
|
if(authorizationHeader == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] splitValues = authorizationHeader.trim().split(" ");
|
|
|
|
|
byte[] decodedBytes = Base64Utils.decode(splitValues[1].trim());
|
|
|
|
|
if (decodedBytes != null) {
|
|
|
|
|