net.continuumsecurity.proxy.ZAProxyScanner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atf-toolbox Show documentation
Show all versions of atf-toolbox Show documentation
Automation Testing Framework Toolbox Provides simple automation.
package net.continuumsecurity.proxy;
import edu.umass.cs.benchlab.har.HarEntry;
import edu.umass.cs.benchlab.har.HarLog;
import edu.umass.cs.benchlab.har.HarRequest;
import edu.umass.cs.benchlab.har.tools.HarFileReader;
import net.continuumsecurity.proxy.model.AuthenticationMethod;
import net.continuumsecurity.proxy.model.Context;
import net.continuumsecurity.proxy.model.ScanResponse;
import net.continuumsecurity.proxy.model.Script;
import net.continuumsecurity.proxy.model.User;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.openqa.selenium.Proxy;
import org.zaproxy.clientapi.core.Alert;
import org.zaproxy.clientapi.core.ApiResponse;
import org.zaproxy.clientapi.core.ApiResponseElement;
import org.zaproxy.clientapi.core.ApiResponseList;
import org.zaproxy.clientapi.core.ApiResponseSet;
import org.zaproxy.clientapi.core.ClientApi;
import org.zaproxy.clientapi.core.ClientApiException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import java.util.regex.Pattern;
public class ZAProxyScanner implements ScanningProxy, Spider, Authentication, ContextModifier {
private static final String MINIMUM_ZAP_VERSION = "2.6"; // Weekly builds are also allowed.
private final ClientApi clientApi;
private final Proxy seleniumProxy;
private final String apiKey;
Logger log = Logger.getLogger(ZAProxyScanner.class.getName());
public ZAProxyScanner(String host, int port, String apiKey)
throws IllegalArgumentException, ProxyException {
validateHost(host);
validatePort(port);
this.apiKey = apiKey;
clientApi = new ClientApi(host, port, this.apiKey);
validateMinimumRequiredZapVersion();
seleniumProxy = new Proxy();
seleniumProxy.setProxyType(Proxy.ProxyType.PAC);
StringBuilder strBuilder = new StringBuilder();
strBuilder.append("http://").append(host).append(":").append(port).append("/proxy.pac?apikey=").append(this.apiKey);
seleniumProxy.setProxyAutoconfigUrl(strBuilder.toString());
}
private static void validateHost(String host) {
if (host == null) {
throw new IllegalArgumentException("Parameter host must not be null.");
}
if (host.isEmpty()) {
throw new IllegalArgumentException("Parameter host must not be empty.");
}
}
private static void validatePort(int port) {
if (port <= 0 || port > 65535) {
throw new IllegalArgumentException("Parameter port must be between 1 and 65535.");
}
}
private static boolean validZAPVersion(String expected, String given) {
final String[] expectedVersion = expected.split("\\.");
final String[] givenVersion = given.split("\\.");
// Assumption: If the version # doesn't have ".", it is weekly build.
if (givenVersion.length == 1) {
return true;
}
for (int i = 0; i < expectedVersion.length; i++) {
if (i < expectedVersion.length) {
if (Integer.parseInt(givenVersion[i]) < Integer.parseInt(expectedVersion[i])) {
return false;
}
if (Integer.parseInt(givenVersion[i]) > Integer.parseInt(expectedVersion[i])) {
return true;
}
}
}
return true;
}
private void validateMinimumRequiredZapVersion() throws ProxyException {
try {
final String zapVersion = ((ApiResponseElement) clientApi.core.version()).getValue();
boolean minimumRequiredZapVersion;
minimumRequiredZapVersion = validZAPVersion(MINIMUM_ZAP_VERSION, zapVersion);
if (!minimumRequiredZapVersion) {
throw new IllegalStateException("Minimum required ZAP version not met, expected >= \""
+ MINIMUM_ZAP_VERSION + "\" but got: " + zapVersion);
}
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setScannerAttackStrength(String scannerId, String strength) throws ProxyException {
try {
clientApi.ascan.setScannerAttackStrength(scannerId, strength, null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException("Error occurred for setScannerAttackStrength for scannerId: "+scannerId+" and strength: "+strength, e);
}
}
@Override
public void setScannerAlertThreshold(String scannerId, String threshold) throws ProxyException {
try {
clientApi.ascan.setScannerAlertThreshold(scannerId, threshold, null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setEnableScanners(String ids, boolean enabled) throws ProxyException {
try {
if (enabled) {
clientApi.ascan.enableScanners(ids, null);
} else {
clientApi.ascan.disableScanners(ids, null);
}
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void disableAllScanners() throws ProxyException {
try {
ApiResponse response = clientApi.pscan.setEnabled("false");
response = clientApi.ascan.disableAllScanners(null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void enableAllScanners() throws ProxyException {
try {
clientApi.pscan.setEnabled("true");
clientApi.ascan.enableAllScanners(null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setEnablePassiveScan(boolean enabled) throws ProxyException {
try {
clientApi.pscan.setEnabled(Boolean.toString(enabled));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List getAlerts() throws ProxyException {
return getAlerts(-1, -1);
}
public void deleteAlerts() throws ProxyException {
try {
clientApi.core.deleteAllAlerts();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public byte[] getXmlReport() {
try {
return clientApi.core.xmlreport();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public byte[] getHtmlReport() throws ProxyException {
try {
return clientApi.core.htmlreport();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List getAlerts(int start, int count) throws ProxyException {
try {
return clientApi.getAlerts("", start, count);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public int getAlertsCount() throws ProxyException {
try {
return ClientApiUtils.getInteger(clientApi.core.numberOfAlerts(""));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public void scan(String url) throws ProxyException {
try {
clientApi.ascan.scan(url, "true", "false", null, null, null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Performs the Active Scan with the given parameters and configuration.
*
* @param url Url to active scan.
* @param contextId Id of the context.
* @param userId Id of the user.
* @param recurse Flag to perform the active scan recursively.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void scanAsUser(String url, String contextId, String userId, boolean recurse)
throws ProxyException {
try {
this.clientApi.ascan
.scanAsUser(url, contextId, userId, String.valueOf(recurse),
null, null, null);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public int getScanProgress(int id) throws ProxyException {
try {
ApiResponseList response = (ApiResponseList) clientApi.ascan.scans();
return new ScanResponse(response).getScanById(id).getProgress();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public void clear() throws ProxyException {
try {
clientApi.ascan.removeAllScans();
clientApi.core.newSession("", "");
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List getHistory() throws ProxyException {
return getHistory(-1, -1);
}
public List getHistory(int start, int count) throws ProxyException {
try {
return ClientApiUtils.getHarEntries(clientApi.core
.messagesHar("", Integer.toString(start), Integer.toString(count)));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public int getHistoryCount() throws ProxyException {
try {
return ClientApiUtils.getInteger(clientApi.core.numberOfMessages(""));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List findInResponseHistory(String regex, List entries) {
List found = new ArrayList();
for (HarEntry entry : entries) {
if (entry.getResponse().getContent() != null) {
String content = entry.getResponse().getContent().getText();
if ("base64".equalsIgnoreCase(entry.getResponse().getContent().getEncoding())) {
content = new String(Base64.decodeBase64(content));
}
if (content.contains(regex)) {
found.add(entry);
}
}
}
return found;
}
public List findInRequestHistory(String regex) throws ProxyException {
try {
return ClientApiUtils
.getHarEntries(clientApi.search.harByRequestRegex(regex, "", "-1", "-1"));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List findInResponseHistory(String regex) throws ProxyException {
try {
return ClientApiUtils
.getHarEntries(clientApi.search.harByResponseRegex(regex, "", "-1", "-1"));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public List makeRequest(HarRequest request, boolean followRedirect)
throws ProxyException {
try {
String harRequestStr = ClientApiUtils.convertHarRequestToString(request);
byte[] response = clientApi.core.sendHarRequest(harRequestStr, Boolean.toString(followRedirect));
String responseAsString = new String(response);
return ClientApiUtils.getHarEntries(response);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
public Proxy getSeleniumProxy() throws UnknownHostException {
return seleniumProxy;
}
@Override
public void spider(String url, Integer maxChildren, boolean recurse, String contextName) {
// Defaulting the context to "Default Context" in ZAP
String contextNameString = contextName == null ? "Default Context" : contextName;
String maxChildrenString = maxChildren == null ? null : String.valueOf(maxChildren);
try {
clientApi.spider
.scan(url, maxChildrenString, String.valueOf(recurse), contextNameString, null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void spider(String url) {
try {
clientApi.spider
.scan(url, null, null, null, null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void spider(String url, boolean recurse, String contextName) {
//Something must be specified else zap throws an exception
String contextNameString = contextName == null ? "Default Context" : contextName;
try {
clientApi.spider
.scan(url, null, String.valueOf(recurse), contextNameString, null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void spiderAsUser(String url, String contextId, String userId) {
try {
clientApi.spider
.scanAsUser(url, contextId, userId, null, null, null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void spiderAsUser(String url, String contextId, String userId, boolean recurse) {
try {
clientApi.spider
.scanAsUser(url, contextId, userId, null, String.valueOf(recurse), null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void spiderAsUser(String url, String contextId, String userId,
Integer maxChildren, boolean recurse) {
try {
clientApi.spider
.scanAsUser(url, contextId, userId, String.valueOf(maxChildren), String.valueOf(recurse), null);
} catch (ClientApiException e) {
e.printStackTrace();
}
}
@Override
public void excludeFromSpider(String regex) {
try {
clientApi.spider.excludeFromScan(regex);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void excludeFromScanner(String regex) {
try {
clientApi.ascan.excludeFromScan(regex);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setAttackMode() throws ProxyException {
try {
clientApi.core.setMode("attack");
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setMaxDepth(int depth) {
try {
clientApi.spider.setOptionMaxDepth(depth);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setPostForms(boolean post) {
try {
clientApi.spider.setOptionPostForm(post);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public void setThreadCount(int threads) {
try {
clientApi.spider.setOptionThreadCount(threads);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public int getLastSpiderScanId() {
try {
ApiResponseList response = (ApiResponseList) clientApi.spider.scans();
return new ScanResponse(response).getLastScan().getId();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public int getLastScannerScanId() {
try {
ApiResponseList response = (ApiResponseList) clientApi.ascan.scans();
return new ScanResponse(response).getLastScan().getId();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public int getSpiderProgress(int id) {
try {
ApiResponseList response = (ApiResponseList) clientApi.spider.scans();
return new ScanResponse(response).getScanById(id).getProgress();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
@Override
public List getSpiderResults(int id) {
List results = new ArrayList();
try {
ApiResponseList responseList = (ApiResponseList) clientApi.spider
.results(Integer.toString(id));
for (ApiResponse response : responseList.getItems()) {
results.add(((ApiResponseElement) response).getValue());
}
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
return results;
}
/**
* Shuts down ZAP.
*
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void shutdown() {
try {
clientApi.core.shutdown();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Enables handling of anti CSRF tokens during active scanning.
*
* @param enabled Boolean flag to enable / disable handling of anti CSRF tokens during active scan.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void setOptionHandleAntiCSRFTokens(boolean enabled) throws ProxyException {
try {
clientApi.ascan.setOptionHandleAntiCSRFTokens(enabled);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Creates a new context with given context name and sets it in scope if @param inScope is true.
*
* @param contextName Name of the context.
* @param inScope true to set context in scope.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void createContext(String contextName, boolean inScope) throws ProxyException {
try {
clientApi.context.newContext(contextName);
clientApi.context.setContextInScope(contextName, String.valueOf(inScope));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Adds include regex to the given context.
*
* @param contextName Name of the context.
* @param regex URL to include in context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void includeRegexInContext(String contextName, Pattern regex) throws ProxyException {
try {
clientApi.context.includeInContext(contextName, Pattern.quote(regex.pattern()));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Adds include parent url to the given content.
*
* @param contextName Name of the context.
* @param parentUrl Parent URL to include in context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void includeUrlTreeInContext(String contextName, String parentUrl)
throws ProxyException {
Pattern pattern = Pattern.compile(parentUrl);
try {
clientApi.context
.includeInContext(contextName, Pattern.quote(pattern.pattern()) + ".*");
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Add exclude regex to the given context.
*
* @param contextName Name of the context.
* @param regex Regex to exclude from context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void excludeRegexFromContext(String contextName, Pattern regex) throws ProxyException {
try {
clientApi.context.excludeFromContext(contextName, Pattern.quote(regex.pattern()));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Add exclude regex to the given context.
*
* @param contextName Name of the context.
* @param parentUrl Parent URL to exclude from context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void excludeParentUrlFromContext(String contextName, String parentUrl)
throws ProxyException {
Pattern pattern = Pattern.compile(parentUrl);
try {
clientApi.context
.excludeFromContext(contextName, Pattern.quote(pattern.pattern()) + ".*");
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Returns Context details for a given context name.
*
* @param contextName Name of context.
* @return Context details for the given context
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public Context getContextInfo(String contextName) throws ProxyException {
Context context;
try {
context = new Context((ApiResponseSet) clientApi.context.context(contextName));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
return context;
}
/**
* Returns list of context names.
*
* @return List of context names.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public List getContexts() throws ProxyException {
String contexts = null;
try {
contexts = ((ApiResponseElement) clientApi.context.contextList()).getValue();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
return Arrays.asList(contexts.substring(1, contexts.length() - 1).split(", "));
}
/**
* Sets the given context in or out of scope.
*
* @param contextName Name of the context.
* @param inScope true - Sets the context in scope. false - Sets the context out of scope.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void setContextInScope(String contextName, boolean inScope) throws ProxyException {
try {
clientApi.context.setContextInScope(contextName, String.valueOf(inScope));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Returns the list of included regexs for the given context.
*
* @param contextName Name of the context.
* @return List of include regexs.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public List getIncludedRegexs(String contextName) throws ProxyException {
String includedRegexs;
try {
includedRegexs = ((ApiResponseElement) clientApi.context.includeRegexs(contextName))
.getValue();
if (includedRegexs.length() > 2) {
return Arrays
.asList(includedRegexs.substring(1, includedRegexs.length() - 1).split(", "));
}
} catch (ClientApiException e) {
throw new ProxyException(e);
}
return null;
}
/**
* Returns the list of excluded regexs for the given context.
*
* @param contextName Name of the context.
* @return List of exclude regexs.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public List getExcludedRegexs(String contextName) throws ProxyException {
String excludedRegexs = null;
try {
excludedRegexs = ((ApiResponseElement) clientApi.context.excludeRegexs(contextName))
.getValue();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
if (excludedRegexs.length() > 2) {
return Arrays
.asList(excludedRegexs.substring(1, excludedRegexs.length() - 1).split(", "));
}
return null;
}
/**
* Returns the supported authentication methods by ZAP.
*
* @return list of supported authentication methods.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public List getSupportedAuthenticationMethods() throws ProxyException {
ApiResponseList apiResponseList = null;
try {
apiResponseList = (ApiResponseList) clientApi.authentication
.getSupportedAuthenticationMethods();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
List supportedAuthenticationMethods = new ArrayList();
for (ApiResponse apiResponse : apiResponseList.getItems()) {
supportedAuthenticationMethods.add(((ApiResponseElement) apiResponse).getValue());
}
return supportedAuthenticationMethods;
}
/**
* Returns logged in indicator pattern for the given context.
*
* @param contextId Id of the context.
* @return Logged in indicator for the given context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public String getLoggedInIndicator(String contextId) throws ProxyException {
try {
return ((ApiResponseElement) clientApi.authentication.getLoggedInIndicator(contextId))
.getValue();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Returns logged out indicator pattern for the given context.
*
* @param contextId Id of the context.
* @return Logged out indicator for the given context.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public String getLoggedOutIndicator(String contextId) throws ProxyException {
try {
return ((ApiResponseElement) clientApi.authentication.getLoggedOutIndicator(contextId))
.getValue();
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Sets the logged in indicator to a given context.
*
* @param contextId Id of a context.
* @param loggedInIndicatorRegex Regex pattern for logged in indicator.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void setLoggedInIndicator(String contextId, String loggedInIndicatorRegex)
throws ProxyException {
try {
clientApi.authentication
.setLoggedInIndicator(contextId, Pattern.quote(loggedInIndicatorRegex));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Sets the logged out indicator to a given context.
*
* @param contextId Id of a context.
* @param loggedOutIndicatorRegex Regex pattern for logged out indicator.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public void setLoggedOutIndicator(String contextId, String loggedOutIndicatorRegex)
throws ProxyException {
try {
clientApi.authentication
.setLoggedOutIndicator(contextId, Pattern.quote(loggedOutIndicatorRegex));
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
}
/**
* Returns authentication method info for a given context.
*
* @param contextId Id of a context.
* @return Authentication method name for the given context id.
* @throws ProxyException - thrown if we are unable to connect to the proxy server
*/
@Override
public Map getAuthenticationMethodInfo(String contextId) throws ProxyException {
Map authenticationMethodDetails = new HashMap();
ApiResponse apiResponse = null;
try {
apiResponse = clientApi.authentication.getAuthenticationMethod(contextId);
} catch (ClientApiException e) {
e.printStackTrace();
throw new ProxyException(e);
}
if (apiResponse instanceof ApiResponseElement) {
authenticationMethodDetails
.put("methodName", ((ApiResponseElement) apiResponse).getValue());
} else if (apiResponse instanceof ApiResponseSet) {
ApiResponseSet apiResponseSet = (ApiResponseSet) apiResponse;
String authenticationMethod = apiResponseSet.getStringValue("methodName");
authenticationMethodDetails.put("methodName", authenticationMethod);
if (authenticationMethod
.equals(AuthenticationMethod.FORM_BASED_AUTHENTICATION.getValue())) {
List