<commit_before>/*  Package Jabber Server
 *  Copyright (C) 2001, 2002, 2003, 2004, 2005
 *  "<NAME>" <<EMAIL>>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * $Rev$
 * Last modified by $Author$
 * $Date$
 */
package tigase.auth;

import java.util.Map;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
import javax.security.sasl.Sasl;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
import tigase.xmpp.XMPPResourceConnection;

/**
 * Describe class TigaseSasl here.
 *
 *
 * Created: Sun Feb 19 10:22:54 2006
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version $Rev$
 */
public class TigaseSasl {

	public static SaslServer createSaslServer(final String mechanism,
		final String protocol, final String serverName, final Map<String,?> props,
		final XMPPResourceConnection connection) throws SaslException {
		AppConfigurationEntry[] saslConfig =
			Configuration.getConfiguration().getAppConfigurationEntry("auth-sasl");
		SaslCallbackHandler sch =
			new SaslCallbackHandler(saslConfig[0].getOptions(), connection);
		return Sasl.createSaslServer(mechanism, protocol, serverName, props, sch);
	}

} // TigaseSasl<commit_msg>Small experiments with auth framework<commit_after>/*  Package Jabber Server
 *  Copyright (C) 2001, 2002, 2003, 2004, 2005
 *  "<NAME>" <<EMAIL>>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * $Rev$
 * Last modified by $Author$
 * $Date$
 */
package tigase.auth;

import java.util.Map;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
import javax.security.sasl.Sasl;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
import tigase.xmpp.XMPPResourceConnection;

/**
 * Describe class TigaseSasl here.
 *
 *
 * Created: Sun Feb 19 10:22:54 2006
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version $Rev$
 */
public class TigaseSasl {

	public static SaslServer createSaslServer(final String mechanism,
		final String protocol, final String serverName, final Map<String,?> props,
		final XMPPResourceConnection connection) throws SaslException {
// 		AppConfigurationEntry[] saslConfig =
// 			Configuration.getConfiguration().getAppConfigurationEntry("auth-sasl");
// 		SaslCallbackHandler sch =
// 			new SaslCallbackHandler(saslConfig[0].getOptions(), connection);
		return Sasl.createSaslServer(mechanism, protocol, serverName, props, null);
	}

} // TigaseSasl
{'fraction_non_alphanumeric': 0.09499091616921879, 'fraction_numerical': 0.024915650142745913, 'mean_word_length': 4.435825105782793, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '948939', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1148, 'n_words': 405}