* @param protocol The non-null string name of the protocol for which the authentication is being performed (e.g., "ldap").
{
* @param serverName The non-null fully qualified host name of the server to authenticate to.
Log.debug("This implementation is unable to create a SaslServer instance for the {} mechanism using the provided properties.",mechanism);
* @param props The possibly null set of properties used to select the SASL mechanism and to configure the authentication exchange of the selected mechanism.
returnnull;
* @param cbh The possibly null callback handler to used by the SASL mechanisms to get further information from the application/library to complete the authentication.
}
* @return A possibly null SaslServer created using the parameters supplied. If null, this factory cannot produce a SaslServer using the parameters supplied.
* @throws SaslException If cannot create a SaslServer because of an error.
switch(mechanism.toUpperCase())
*/
{
case"PLAIN":
if(cbh!=null)
{
Log.debug("Unable to instantiate {} SaslServer: A callbackHandler with support for Password, Name, and AuthorizeCallback required.",mechanism);
Log.debug("Unable to instantiate {} Sasl Server: Provided properties contains neither LocalClientSession nor LocalIncomingServerSession instance.",mechanism);
returnnull;
}
caseJiveSharedSecretSaslServer.NAME:
returnnewJiveSharedSecretSaslServer();
default:
thrownewIllegalStateException();// Fail fast - this should not be possible, as the first check in this method already verifies wether the mechanism is supported.