server.setSubsystemFactories(namedFactoryList);
//
for (AuthenticationPlugin authenticationPlugin : authenticationPlugins) {
if (server.getPasswordAuthenticator() == null && authenticationPlugin.getCredentialType().equals(String.class)) {
server.setPasswordAuthenticator(new PasswordAuthenticator() {
public boolean authenticate(String _username, String _password, ServerSession session) {
if (genericAuthenticate(String.class, _username, _password)) {
// We store username and password in session for later reuse
session.setAttribute(USERNAME, _username);
session.setAttribute(PASSWORD, _password);